&& !
$request->
hasHeader('Transfer-Encoding'
) ) { $size =
$request->
getBody()->
getSize();
if ($size !== null
) { $modify['set_headers'
]['Content-Length'
] =
$size;
} else { $modify['set_headers'
]['Transfer-Encoding'
] = 'chunked';
} } // Add the expect header if needed.
$this->
addExpectHeader($request,
$options,
$modify);
return $fn(Psr7\Utils::
modifyRequest($request,
$modify),
$options);
} /**
* Add expect header
*/
private function addExpectHeader(RequestInterface
$request, array
$options, array &
$modify): void
{ // Determine if the Expect header should be used
if ($request->
hasHeader('Expect'
)) {