I am working on development of my Android java application which utilizes Microsoft graph API to upload files to OneDrive.
I see the offical article mentions:
enter image description here
It seems that it’s feasible to upload small files to Onedrive with a customized confliction resolution behavior by PUT request.
Does anyone know how to make such a request with a customized confliction resolution behavior?
Currently I am using graph sdk to make my life easier. It’s even better someone can provide me code example to achive that.
What I have tried:
Graph sdk PUT request with customized request option:
FunctionOption option = new FunctionOption("@microsoft.graph.conflictBehavior",new JsonPrimitive("rename"));
mClient.getGraphServiceClient().me().drive().items(parent)
.itemWithPath("/" + mMetaData.getName())
.content()
.buildRequest(option)
.put(stream);
Expected: file can be uploaded with error
Actual result: 400 Bad Request