Cannot upload file into OneDrive (content type error)
@koros arbeitet bereits daran.
Seit 25.7.2023.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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
- Vorherrschende Sprache
- TypeScript
- Sterne
- 833
- Forks
- 240
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoftgraph/msgraph-sdk-javascript
-
status:waiting-for-triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
-
Is anyone here? Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 Reaktion ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? Offenstatus:waiting-for-triage
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 42/100
-
status:waiting-for-triage type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 Kommentare · 1 Reaktion ·
-
status:waiting-for-triage type:bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
Alle Issues in microsoftgraph/msgraph-sdk-javascript
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
fil-donadoni/tolaria#4409 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
corsairdev/corsair#1764 ·