PrepareBodyMiddleware
in package
Prepares requests that contain a body, adding the Content-Length, Content-Type, and Expect headers.
Table of Contents
- $nextHandler : callable
- __construct() : mixed
- __invoke() : PromiseInterface
- addExpectHeader() : void
- Add expect header
Properties
$nextHandler
private
callable
$nextHandler
Methods
__construct()
public
__construct(callable $nextHandler) : mixed
Parameters
- $nextHandler : callable
-
Next handler to invoke.
Return values
mixed —__invoke()
public
__invoke(RequestInterface $request, array<string|int, mixed> $options) : PromiseInterface
Parameters
- $request : RequestInterface
- $options : array<string|int, mixed>
Return values
PromiseInterface —addExpectHeader()
Add expect header
private
addExpectHeader(RequestInterface $request, array<string|int, mixed> $options, array<string|int, mixed> &$modify) : void
Parameters
- $request : RequestInterface
- $options : array<string|int, mixed>
- $modify : array<string|int, mixed>