Unable to upload large attachment. In the file Microsoft\Kiota\Abstractions\RequestHeaders, the array_keys function is used, which casts a string to a number. PHP 8.4 on x64 does this.
In the getAll method, it is cast and then an error is returned: 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.
A method with array_keys that casts string to int.
public function getAll(): array
{
$result = [];
foreach ($this->headers as $key => $value) {
$result[$key] = array_keys($value);
}
return $result;
}
A method with foreach that works.
public function getAll(): array
{
$result = [];
foreach ($this->headers as $key => $value) {
foreach ($value as $k => $v) {
$result[$key][] = strval($k);
}
//$result[$key] = array_keys($value);
}
return $result;
}
After this change, sending large attachments works.
Unable to upload large attachment. In the file Microsoft\Kiota\Abstractions\RequestHeaders, the array_keys function is used, which casts a string to a number. PHP 8.4 on x64 does this.
In the getAll method, it is cast and then an error is returned: 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.
A method with array_keys that casts string to int.
A method with foreach that works.
After this change, sending large attachments works.