Amp\Artax\StringBody class StringBody implements Amp\Artax\RequestBody

Summary

Properties

Methods

Properties

Methods

__construct — public function __construct(string $body)
No documentation.
Type Parameter Description Default Value
string $body No documentation. none
createBodyStream — public function createBodyStream(): Amp\ByteStream\InputStream

Create the HTTP message body to be sent.

Further calls MUST return a new stream to make it possible to resend bodies on redirects.

getHeaders — public function getHeaders(): Amp\Promise

Retrieve a key-value array of headers to add to the outbound request.

The resolved promise value must be a key-value array mapping header fields to values.

getBodyLength — public function getBodyLength(): Amp\Promise

Retrieve the HTTP message body length. If not available, return -1.