microsoft / microsoft/kiota-php
[PHP] Error sending request via GuzzleHttp
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 8
- Forks
- 10
- Avg merge
- 10h 16m
- Merged PRs (30d)
- 3
Description
What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Nuget tool
Client library/SDK language
PHP
Describe the bug
Unable to upload large attachment. In the file Microsoft\Kiota\Abstractions\RequestHeaders, the array_keys function is used, which returns keys as numbers. If a large file is sent that is split into smaller parts, the size of the part is sent. However, the size is a number, so the key is cast to a number. This is a PHP feature, where a key that looks like a number is cast to a number. See the issue: https://github.com/microsoftgraph/msgraph-sdk-php/issues/1794
An error is returned in the getAll method: Since guzzlehttp/psr7 2.11: Passing int to GuzzleHttp\Psr7\Request::__construct() is deprecated; guzzlehttp/psr7 3.0 requires string|string[].
Instead of array_keys, you must use foreach.
Expected behavior
See description
How to reproduce
See description
Open API description file
No response
Kiota Version
2.0.2
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
No response
Configuration
No response
Debug output
Click to expand log
```</details>
### Other information
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Microsoft\Kiota\Abstractions\RequestHeaders and inspect the getAll method, especially its handling of numeric-looking header values. Reproduce the large multipart upload scenario described in the issue and verify that the resulting request no longer passes an integer to GuzzleHttp\Psr7\Request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100