\GuzzleHttp\Psr7MultipartStream

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

Summary

Methods
Properties
Constants
__construct()
__get()
__toString()
getContents()
__call()
close()
getMetadata()
detach()
getSize()
eof()
tell()
isReadable()
isWritable()
isSeekable()
rewind()
seek()
read()
write()
getBoundary()
No public properties found
No constants found
createStream()
No protected properties found
N/A
getHeaders()
addElement()
createElement()
getHeader()
$boundary
N/A

Properties

$boundary

$boundary

Methods

__construct()

__construct(array  $elements = [], string  $boundary = null) : mixed

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

Returns

mixed —

__get()

__get(string  $name) : \Psr\Http\Message\StreamInterface

Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).

Parameters

string $name

Name of the property (allows "stream" only).

Returns

\Psr\Http\Message\StreamInterface —

__toString()

__toString() : mixed

Returns

mixed —

getContents()

getContents() : mixed

Returns

mixed —

__call()

__call(string  $method, array  $args) : mixed

Allow decorators to implement custom methods

Parameters

string $method

Missing method name

array $args

Method arguments

Returns

mixed —

close()

close() : mixed

Returns

mixed —

getMetadata()

getMetadata(mixed  $key = null) : mixed

Parameters

mixed $key

Returns

mixed —

detach()

detach() : mixed

Returns

mixed —

getSize()

getSize() : mixed

Returns

mixed —

eof()

eof() : mixed

Returns

mixed —

tell()

tell() : mixed

Returns

mixed —

isReadable()

isReadable() : mixed

Returns

mixed —

isWritable()

isWritable() : bool

Returns whether or not the stream is writable.

Returns

bool —

isSeekable()

isSeekable() : mixed

Returns

mixed —

rewind()

rewind() : mixed

Returns

mixed —

seek()

seek(mixed  $offset, mixed  $whence = SEEK_SET) : mixed

Parameters

mixed $offset
mixed $whence

Returns

mixed —

read()

read(mixed  $length) : mixed

Parameters

mixed $length

Returns

mixed —

write()

write(mixed  $string) : mixed

Parameters

mixed $string

Returns

mixed —

getBoundary()

getBoundary() : string

Get the boundary

Returns

string —

createStream()

createStream(array  $elements) : mixed

Create the aggregate stream that will be used to upload the POST data

Parameters

array $elements

Returns

mixed —

getHeaders()

getHeaders(array  $headers) : mixed

Get the headers needed before transferring the content of a POST file

Parameters

array $headers

Returns

mixed —

addElement()

addElement(\GuzzleHttp\Psr7\AppendStream  $stream, array  $element) : mixed

Parameters

\GuzzleHttp\Psr7\AppendStream $stream
array $element

Returns

mixed —

createElement()

createElement(mixed  $name, \Psr\Http\Message\StreamInterface  $stream, mixed  $filename, array  $headers) : array

Parameters

mixed $name
\Psr\Http\Message\StreamInterface $stream
mixed $filename
array $headers

Returns

array —

getHeader()

getHeader(array  $headers, mixed  $key) : mixed

Parameters

array $headers
mixed $key

Returns

mixed —