Cannot upload file into OneDrive (content type error)
@koros 已经在做这个了。
开始于 2023年7月25日。
评估
这个 Issue 还没有评估数据。
描述
Bug Report
Prerequisites
- Can you reproduce the problem?
- Are you running the latest version?
- Are you reporting to the correct repository?
- Did you perform a cursory search?
For more information, see the CONTRIBUTING guide.
Description
Cannot make a PUT request to upload file into OneDrive. The API returns Unable to read JSON request payload error. The docs here say to use text/plain content type, but the library here has it hardcoded to JSON.
Console Errors: [Is there any console error]
{
statusCode: 400,
code: 'BadRequest',
requestId: '6418fb30-de6e-4b41-a53c-7e96eebc348b',
date: 2023-05-12T07:51:14.000Z,
body: '{"code":"BadRequest","message":"Unable to read JSON request payload. Please ensure Content-Type header is set and payload is of valid JSON format.","innerError":{"date":"2023-05-12T09:51:14","request-id":"6418fb30-de6e-4b41-a53c-7e96eebc348b","client-request-id":"8142eabc-e22d-a7eb-c8f6-be9ebc37899f"}}',
headers: Headers {
[Symbol(map)]: [Object: null prototype] {
'transfer-encoding': [ 'chunked' ],
'content-type': [ 'application/json' ],
'content-encoding': [ 'gzip' ],
vary: [ 'Accept-Encoding' ],
'strict-transport-security': [ 'max-age=31536000' ],
'request-id': [ '6418fb30-de6e-4b41-a53c-7e96eebc348b' ],
'client-request-id': [ '8142eabc-e22d-a7eb-c8f6-be9ebc37899f' ],
'x-ms-ags-diagnostic': [
'{"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"002","RoleInstance":"AM2PEPF0000BE20"}}'
],
date: [ 'Fri, 12 May 2023 09:51:13 GMT' ],
connection: [ 'close' ]
}
}
}
Screenshots: [If applicable, add screenshots to help explain your problem]
Steps to Reproduce
const filename = 'file.csv';
const content = 'content';
await.client.api(`/drives/${this.driveId}/items/${this.folderId}:/${filename}:/content`).put(content);
Expected behavior: PUT is succesfully sent and file is uploaded
Actual behavior: PUT was sent with invalid content type
Additional Context
Add any other context about the problem here..
Usage Information
check log above
- 主要语言
- TypeScript
- 星标
- 833
- 派生
- 240
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoftgraph/msgraph-sdk-javascript 的其他 Issue
-
status:waiting-for-triage
难度 1/5 1 小时以内 新手友好度 62/100
-
Is anyone here? 未关闭
难度 4/5 3-5 天 新手友好度 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 个 reaction ·
-
status:waiting-for-triage
难度 5/5 一周以上 新手友好度 42/100
-
status:waiting-for-triage type:bug
难度 3/5 1-2 天 新手友好度 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 条评论 · 1 个 reaction ·
-
status:waiting-for-triage type:bug
难度 4/5 3-5 天 新手友好度 45/100
查看 microsoftgraph/msgraph-sdk-javascript 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 75/100
fil-donadoni/tolaria#4409 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
corsairdev/corsair#1764 ·