Error 400 during put on drive item
@PrzemyslawSagalo がすでに取り組んでいます。
2024年6月3日 から。
評価
この issue はまだ評価されていません。
説明
Describe the bug
I am trying to upload a .docx file into OneDrive using Graph API. Unfortunately, it returns an error 400.
msgraph.generated.models.o_data_errors.o_data_error.ODataError:
{
APIError
Code: 400
error: MainError(code='BadRequest', message='Entity only allows writes with JSON Content-Type header.')
}
Expected behavior
Based on the type from the code of the sdk passed type is correct, so I don't understand this behaviour and the bellow code should upload the file.
How to reproduce
file_path = "test.docx"
with open(file_path, "rb") as file_handle:
file_bytes = file_handle.read()
item_path = "/root:/Documents/test_on_one_drive.docx"
r = await client.drives.by_drive_id(drive_id).items.by_drive_item_id(item_path).content.put(body=file_bytes)
SDK Version
1.4.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- 主要言語
- Python
- スター
- 630
- フォーク
- 96
- 平均マージ
- 15時間 20分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/msgraph-sdk-python のほかの issue
-
status:waiting-for-triage type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
microsoftgraph/msgraph-sdk-python#1570 ·
-
status:waiting-for-triage type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoftgraph/msgraph-sdk-python#1563 ·
-
Needs: Attention :wave: type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
microsoftgraph/msgraph-sdk-python#1287 · コメント 2 件 · リアクション 1 件 ·
-
status:waiting-for-triage
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
microsoftgraph/msgraph-sdk-python#1557 ·
-
status:waiting-for-triage type:bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
microsoftgraph/msgraph-sdk-python#1556 · コメント 1 件 · リアクション 1 件 ·
microsoftgraph/msgraph-sdk-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
🐛 Bug 🔔 Pending processing
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
jumpserver/jumpserver#17584 ·