Amp\Artax\RequestBody interface RequestBody

An interface for generating HTTP message bodies + headers.

Summary

Properties

Methods

Methods

getHeaders — public function getHeaders(): Amp\Artax\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.

createBodyStream — public function createBodyStream(): Amp\Artax\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.

getBodyLength — public function getBodyLength(): Amp\Artax\Promise

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