msgraph-sdk-python
msgraph-sdk-python copied to clipboard
How to add @microsoft.graph.conflictBehavior to a PUT request?
I have this piece of code:
await client.drives \
.by_drive_id(drive_id) \
.items \
.by_drive_item_id(f'root:/foo/baz/bar.txt:') \
.content \
.put(body)
I want it to fail if the file already exists.
According to this StackOverflow answer, I have to add @microsoft.graph.conflictBehavior with a value of fail somewhere. My question is: where? There's no additional_data key where I can pass this to, like it is shown in some other examples.
The conflict behaviour is set in the url.
We will need to provide a sample for python that is similar to https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/upgrade-to-v5.md#upload-a-small-file-with-conflictbehavior-set
hello, any update on this ? i can't move any item using replace conflict behavior.