Messages.Item.SendRequestBuilder.ToPostRequestInformation() does not work in batch. #2628
Labels
area:documentation
Focused on documentation of the product
Status: Needs investigation
type:bug
A broken experience
Describe the bug
Including following post request information into batch
var sendDraftRequest = _graphClient.Me.Messages[messageId].Send.ToPostRequestInformation();
returns the following error inside batch:
{"error":{"code":"BadRequest","message":"Write request id : f4f09b02-155a-47e7-86da-a89930ad6590 does not contain Content-Type header or body.","innerError":{"date":"2024-08-19T01:08:18","request-id":"7d3af893-af46-4dc4-9dbb-c4edd72dcd92","client-request-id":"31088810-bb70-466a-895c-925e315ef7a8"}}}
This documentation states that body is not required.
I extracted this error from the BatchResponseContentCollection itself in the debugger, because none of the APIs provided returns a response for the actual request.
BatchResponseContentCollection.GetResponseByIdAsync does not return any responses for the error even though the collection itself have the proper ids:
1. Confirming requestId
2.1. Confirming that response exists
2.2 Confirming that key that associated with the response exists
3. Confirming that response is not returned by proper id
Expected behavior
If no error, POST request is executed inside batch.
If error, return the request error with BatchResponseContentCollection.GetResponseByIdAsync
How to reproduce
Just include _graphClient.Me.Messages[messageId].Send.ToPostRequestInformation() request information inside a batch using AddBatchRequestStepAsync
SDK Version
5.56.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
The text was updated successfully, but these errors were encountered: