class StreamTransport extends AbstractTransport (View source)

The StreamTransport class.

Methods

__construct(array|ArrayAccess $options = array())

Constructor.

ResponseInterface
request(RequestInterface $request)

Send a request to the server and return a Response object with the response.

mixed
getOption(string $name, mixed $default = null)

Get option value.

setOption(string $name, mixed $value)

Set option value.

array
getOptions()

Method to get property Options

setOptions(array $options)

Method to set property options

ResponseInterface
download(RequestInterface $request, string|StreamInterface $dest)

Use stream to download file.

static boolean
isSupported()

Method to check if HTTP transport layer available for using

Details

__construct(array|ArrayAccess $options = array())

Constructor.

Parameters

array|ArrayAccess $options Client options object.

ResponseInterface request(RequestInterface $request)

Send a request to the server and return a Response object with the response.

Parameters

RequestInterface $request The request object to store request params.

Return Value

ResponseInterface

mixed getOption(string $name, mixed $default = null)

Get option value.

Parameters

string $name Option name.
mixed $default The default value if not exists.

Return Value

mixed The found value or default value.

AbstractTransport setOption(string $name, mixed $value)

Set option value.

Parameters

string $name Option name.
mixed $value The value you want to set in.

Return Value

AbstractTransport Return self to support chaining.

array getOptions()

Method to get property Options

Return Value

array

AbstractTransport setOptions(array $options)

Method to set property options

Parameters

array $options

Return Value

AbstractTransport Return self to support chaining.

at line line 213
ResponseInterface download(RequestInterface $request, string|StreamInterface $dest)

Use stream to download file.

Parameters

RequestInterface $request The request object to store request params.
string|StreamInterface $dest The dest path to store file.

Return Value

ResponseInterface

at line line 240
static boolean isSupported()

Method to check if HTTP transport layer available for using

Return Value

boolean True if available else false