Microsoft Graph API-上载块时,可恢复上载返回404 [英] Microsoft Graph API - Resumable upload returns 404 when uploading chunk

查看:89
本文介绍了Microsoft Graph API-上载块时,可恢复上载返回404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照此答案问题上传可恢复上传的第一块内容时,我删除了Authorization标头.

Following the answer to this question I removed my Authorization header when uploading the first chunk of my resumable upload.

因此创建会话:

POST https://graph.microsoft.com/V1.0/groups/a0aab702-8e58-4f25-b2dd-066e5d110f0c/drive/root:/10cb244a-d181-44df-aabc-51c30d4cf0f5.txt:/createUploadSession HTTP/1.1
Authorization: Bearer XXX
Content-Type: application/json; charset=utf-8
Host: graph.microsoft.com
Content-Length: 75
Expect: 100-continue

{
  "item": {
    "@microsoft.graph.conflictBehaviour": "replace"
  }
}

响应:

HTTP/1.1 200 OK
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Location: https://graph.microsoft.com
request-id: 9d93ade6-8072-438b-a9fb-c648376b77ba
client-request-id: 9d93ade6-8072-438b-a9fb-c648376b77ba
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"North Europe","Slice":"SliceB","ScaleUnit":"002","Host":"AGSFE_IN_5","ADSiteName":"DUB"}}
OData-Version: 4.0
Duration: 1750.2813
Date: Thu, 27 Apr 2017 16:06:35 GMT

93d
{"@odata.context":"https://graph.microsoft.com/V1.0/$metadata#microsoft.graph.uploadSession","expirationDateTime":"2017-04-27T16:21:35.2923217Z","nextExpectedRanges":["0-"],"uploadUrl":"https://peterreay2.sharepoint.com/sites/SharePointTests/_api/v2.0/drive/items/01RZBHEZF6Y2GOVW7725BZO354PWSELRRZ/uploadSession?guid='e13f861f-7aa0-4f9a-b05c-26587ecfab92'&path='~tmp0E_10cb244a-d181-44df-aabc-51c30d4cf0f5.txt'&overwrite=True&rename=False&access_token=XXX&prooftoken=XXX"}
0

所以我然后尝试上传我的第一个块,但是我得到了404 not found响应:

So I then try and upload my first chunk, however I'm getting a 404 not found response:

PUT https://peterreay2.sharepoint.com/sites/SharePointTests/_api/v2.0/drive/items/01RZBHEZF6Y2GOVW7725BZO354PWSELRRZ/uploadSession?guid='e13f861f-7aa0-4f9a-b05c-26587ecfab92'&path='~tmp0E_10cb244a-d181-44df-aabc-51c30d4cf0f5.txt'&overwrite=True&rename=False&access_token=XXX&prooftoken=XXX HTTP/1.1
Content-Range: bytes 0-10485759/11534336
Host: peterreay2.sharepoint.com
Content-Length: 10485760
Expect: 100-continue
Connection: Keep-Alive

0123456  etc

响应:

HTTP/1.1 404 Not Found
Server: Microsoft-IIS/8.5
SPRequestGuid: 8825ec9d-b0ed-3000-1791-4c35404935e9
request-id: 8825ec9d-b0ed-3000-1791-4c35404935e9
Strict-Transport-Security: max-age=31536000
X-FRAME-OPTIONS: SAMEORIGIN
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 16.0.0.6420
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
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"
Date: Thu, 27 Apr 2017 16:08:25 GMT
Connection: close
Content-Length: 0

与我的另一个问题一样,执行此操作的代码也可以正常工作(即使带有Bearer令牌).所以我认为块大小,字节范围等都是正确的.

As in my other question, the code doing this used to work (even with a Bearer token). So I think the chunk sizes, byte ranges etc are correct.

对这里出什么问题有任何想法吗?

Any thoughts on what is going wrong here?

推荐答案

请参阅链接问题的答案

See the answer to the linked question here. There was a bug confirmed and fixed by Microsoft. This fixed our issue with the request including a bearer token. I have not tested this scenario here (without a bearer token).

这篇关于Microsoft Graph API-上载块时,可恢复上载返回404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆