Open sergioalborada opened 5 months ago
Hi @sergioalborada We support inspecting response and request headers for all requests using the request configuration options. Here's a sample:
$config = new UsersRequestBuilderGetRequestConfiguration();
$headersInspectionOption = new HeadersInspectionHandlerOption(true);
$config->options = [$headersInspectionOption];
$result = $graphServiceClient->users()->post($user, $config);
$responseHeaders = $headersInspectionOption->getResponseHeaders();
Let me know if this helps
When using the GuzzleRequestAdapter in the Microsoft Graph SDK, certain API calls (such as creating a team) return an empty result.
The problem is that the current implementation of sendAsync returns null for empty responses, even thought there may be important information in the headers.
So, in my opinioin, it should either return the raw response in those cases to allow us to read the headers when using the sdk, or either, attempt to build a valid response object from the response headers if the body is empty (at least, if the response code is 201 - Created).