Jun 17 2020 01:24 AM - edited Jun 17 2020 01:26 AM
Hi All,
I need to upload a simple text file in SharepointOnline. While trying to import the file through Postman, I am getting the error as "Could not get response".
Request help for the case.
Jun 17 2020 01:35 AM
Jun 17 2020 01:55 AM
Since I am new to sharepoint and might have done something wrong. Hence, I am writing the steps that are performed:
1. API that is build: Site/_api/web/GetFolderByServerRelativeUrl('/Folder name')/Files/add(url='abc.txt',overwrite=true)
2. Authorization, Content length and X-RequestDigest values are passed.
3. File is added in the body header.
Pls let me know in case something is wrong.
Jun 17 2020 02:12 AM
Jun 17 2020 03:25 AM
@Ricardo Viana I have checked the postman Console and error is appearing as "read ECONNRESET". Do you have any idea regarding this?
Jun 17 2020 10:24 AM
1) Hope you are not missing any of the steps below:
POST https://{site_url}/_api/web/GetFolderByServerRelativeUrl('/Folder Name')/Files/add(url='a.txt',overwrite=true)
Authorization: "Bearer " + accessToken
Content-Length: {length of request body as integer}
X-RequestDigest: "{form_digest_value}"
To get the access token please follow each steps as per given in below blog(written by me):
2) Also check if your settings for the POSTMAN tool as per below:
setting ->general -> Requesttimeout in ms = 0
Jun 17 2020 09:14 PM
Yes, I am following all the steps. Please look at it.
1. URL: https://abc.sharepoint.com/sites/site_Testing/_api/web/GetFolderByServerRelativeUrl('/sites/site_Tes... Documents/DEF')/Files/add(url='test2.txt',overwrite=true)
2. Below are the Header Parameters that are incorporated:
a. Accept --> application/json;odata=verbose
b. Authorization --> Bearer aasdcsfs
c. x-requestDigest --> iouhdushd8s89
Could you pls tell me the way to calculate content-length(I am not sure regarding this and have put 20).
Also, I had computed x-requestDigest value from http://abc.sharepoint.com/sites/site_Testing/_api/contextinfo
Requesttimeout in ms = 0 (This is done).
Pls let me know the mistake that I had performed so far.