You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The current implementation of Copy endpoint for drive items is incorrect, as it tries to return a DriveItem as the result. The Graph API documentation shows that it instead sends back a URI in the Location response header. #768 seemed to show that it was possible to access the response headers, however this ability is either hidden to me or has been changed and is therefore no longer accessible.
To Reproduce
var copyResponse = this.GraphServiceClient
.Drives[driveId]
.Items[driveItemId]
.Copy.PostAsync(copyRequestBody);
Expected behavior
Rather than trying to find "workarounds" to get the Location URI, why can't the Copy method just return the URI as the result?
No other relevant information
The text was updated successfully, but these errors were encountered:
hazzinator1
changed the title
DriveItem Copy endpoint does not work
DriveItem Copy endpoint has incorrect return type
Dec 4, 2023
varnativeResponseHandler=new NativeResponseHandler();await graphClient.Drives["drive-id"].Items["item-id"].Copy.PostAsync(copyRequestBody,requestConfiguration => requestConfiguration.Options.Add(new ResponseHandlerOption{ResponseHandler=nativeResponseHandler}));varresponseMessage= nativeResponseHandler.Value as HttpResponseMessage;varlocationheader= responseMessage.Headers.Location.OriginalString;
As this falls under the polling of long running operations, this work is currently pending the resolution of microsoftgraph/msgraph-sdk-design#83. We'll close this issue for now to be tracked via #1366
Describe the bug
The current implementation of Copy endpoint for drive items is incorrect, as it tries to return a DriveItem as the result. The Graph API documentation shows that it instead sends back a URI in the Location response header.
#768 seemed to show that it was possible to access the response headers, however this ability is either hidden to me or has been changed and is therefore no longer accessible.
To Reproduce
Expected behavior
Rather than trying to find "workarounds" to get the Location URI, why can't the Copy method just return the URI as the result?
No other relevant information
The text was updated successfully, but these errors were encountered: