You are here

public function MultipartStream::__construct in Lockr 7.3

Parameters

array $elements Array of associative arrays, each containing a: required "name" key mapping to the form field, name, a required "contents" key mapping to a StreamInterface/resource/string, an optional "headers" associative array of custom headers, and an optional "filename" key mapping to a string to send as the filename in the part.

string $boundary You can optionally provide a specific boundary:

Throws

\InvalidArgumentException

Overrides StreamDecoratorTrait::__construct

File

vendor/guzzlehttp/psr7/src/MultipartStream.php, line 28

Class

MultipartStream
Stream that when read returns bytes for a streaming multipart or multipart/form-data stream.

Namespace

GuzzleHttp\Psr7

Code

public function __construct(array $elements = [], $boundary = null) {
  $this->boundary = $boundary ?: sha1(uniqid('', true));
  $this->stream = $this
    ->createStream($elements);
}