Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sendAsync promise return nulls upon creation #112

Open
sergioalborada opened this issue May 14, 2024 · 1 comment
Open

sendAsync promise return nulls upon creation #112

sergioalborada opened this issue May 14, 2024 · 1 comment
Labels
area:serialization Focused on functional modules of the product type:question An issue that's a question

Comments

@sergioalborada
Copy link

sergioalborada commented May 14, 2024

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).

@baywet baywet added this to Kiota May 15, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota May 15, 2024
@Ndiritu
Copy link
Contributor

Ndiritu commented Jul 15, 2024

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

@Ndiritu Ndiritu moved this from Needs Triage 🔍 to Waits for author 🔁 in Kiota Jul 15, 2024
@Ndiritu Ndiritu added type:question An issue that's a question area:serialization Focused on functional modules of the product labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:serialization Focused on functional modules of the product type:question An issue that's a question
Projects
Status: Waits for author 🔁
Development

No branches or pull requests

2 participants