Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Microsoft Graph API-400上载大文件时出错_Graph_Http Status Code 400 - Fatal编程技术网

Microsoft Graph API-400上载大文件时出错

Microsoft Graph API-400上载大文件时出错,graph,http-status-code-400,Graph,Http Status Code 400,我正在尝试使用Graph API在Sharepoint中上载一个大文件(超过5 MB)。 我已经正确地创建了上传会话url(我想,我已经获得了一个看起来不错的url),但是当我尝试使用这个上传url上传我的文件时,我得到了一个400错误的请求错误 这是我的密码: HttpClient uploadRequestClient = new HttpClient(); var uploadRequestContent = new ByteArrayContent(byteContent); var u

我正在尝试使用Graph API在Sharepoint中上载一个大文件(超过5 MB)。 我已经正确地创建了上传会话url(我想,我已经获得了一个看起来不错的url),但是当我尝试使用这个上传url上传我的文件时,我得到了一个400错误的请求错误

这是我的密码:

HttpClient uploadRequestClient = new HttpClient();
var uploadRequestContent = new ByteArrayContent(byteContent);
var uploadResponse = await uploadRequestClient.PutAsync(uploadUrl, uploadRequestContent);
以下是回应:

{StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Cache-Control: no-cache
  Pragma: no-cache
  Transfer-Encoding: chunked
  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: 3
  X-SP-SERVERSTATE: ReadOnly=0
  ODATA-VERSION: 4.0
  SPClientServiceRequestDuration: 78
  X-AspNet-Version: 4.0.30319
  SPRequestGuid: 164ac79f-4051-c000-2787-f80594a3303c
  request-id: 164ac79f-4051-c000-2787-f80594a3303c
  MS-CV: n8dKFlFAAMAnh/gFlKMwPA.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;
  X-Powered-By: ASP.NET
  MicrosoftSharePointTeamServices: 16.0.0.21228
  X-Content-Type-Options: nosniff
  X-MS-InvokeApp: 1; RequireReadOnly
  X-Cache: CONFIG_NOCACHE
  X-MSEdge-Ref: Ref A: BA0EB4BD4A064BB892C1460A96C694AF Ref B: VIEEDGE3019 Ref C: 2021-05-12T21:21:16Z
  Date: Wed, 12 May 2021 21:21:16 GMT
  Content-Type: application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false; charset=utf-8
  Expires: -1
}}
有什么想法吗?谢谢 西蒙尼