使用 API Postman 将文件上传到 SharePoint

Upload file to SharePoint using API Postman

我想使用 Rest API 通过 Oracle 系统将文件上传到 SharePoint。 我尝试了以下但没有运气。

控制台:

POST

https://test.sharepoint.com/sites/BusinessDevelopment/Shared%20Documents/Upload_BMT/_api/web/GetFolderByServerRelativeUrl('P_FIRST')/Files/add(url='abdabd.pdf',overwrite=true):

“请求 Headers”:{

"content-length": "100000",
"authorization": "Bearer access token",
"user-agent": "PostmanRuntime/7.28.4",
"accept": "*/*",
"postman-token": "11",
"host": "test.sharepoint.com",
"accept-encoding": "gzip, deflate, br",
"connection": "keep-alive",
"content-type": "multipart/form-data; boundary=--------------------------327461050037851785007682"

},

“请求Body”:{ “”:“” },

“回应Headers”:{

"cache-control": "private, max-age=0",
"expires": "Mon, 20 Dec 2021 05:18:53 GMT",
"last-modified": "Tue, 04 Jan 2022 05:18:53 GMT",
"vary": "Origin",
"p3p": "CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"",
"x-sharepointhealthscore": "2",
"x-aspnet-version": "4.0.30319",
"sprequestguid": "375b13a0-70ce-c000-bacc-4fdfeefc7910",
"request-id": "375b13a0-70ce-c000-bacc-4fdfeefc7910",
"ms-cv": "oBNbN85wAMC6zE/f7vx5EA.0",
"strict-transport-security": "max-age=31536000",
"x-frame-options": "SAMEORIGIN",
"content-security-policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.powerapps.com *.yammer.com *.officeapps.live.com *.office.com *.stream.azure-test.net *.microsoftstream.com *.dynamics.com;",
"x-powered-by": "ASP.NET",
"microsoftsharepointteamservices": "16.0.0.21924",
"x-content-type-options": "nosniff",
"x-ms-invokeapp": "1; RequireReadOnly",
"x-cache": "CONFIG_NOCACHE",
"x-msedge-ref": "Ref A: 3C3309D8FC4C43CAA72F28D56F17244B Ref B: ZRHEDGE1219 Ref C: 2022-01-04T05:18:53Z",
"date": "Tue, 04 Jan 2022 05:18:53 GMT",
"content-length": "0"

url应该像下面这样

url: http://test.sharepoint.com/sites/testsite/_api/web/GetFolderByServerRelativeUrl('/Library Name/Folder Name')/Files/add(url='a.txt',overwrite=true)