Stream

Extends AbstractTransport

HTTP transport class for using PHP streams.

since

1.0

package

Joomla Framework

Methods

__construct

Constructor.

__construct(array|\ArrayAccess options = []) : mixed
inherited
since

2.0.0

throws

\RuntimeException

Arguments

options

array|\ArrayAccessClient options array.

Response

mixed

getOption

Get an option from the HTTP transport.

getOption(string key, mixed default = null) : mixed
inherited
since

2.0.0

Arguments

key

stringThe name of the option to get.

default

mixedThe default value if the option is not set.

Response

mixedThe option value.

getResponse

Method to get a response object from a server response.

getResponse(array headers, string body) : \Joomla\Http\Response
since

1.0

throws

\Joomla\Http\Exception\InvalidResponseCodeException

Arguments

headers

arrayThe response headers as an array.

body

stringThe response body as a string.

Response

\Joomla\Http\Response

isSupported

Method to check if http transport stream available for use

isSupported() : bool
static
since

1.0

Response

boolTrue if available else false

processHeaders

Processes the headers from a transport's response data.

processHeaders(array headers) : array
inherited
since

2.0.0

Arguments

headers

arrayThe headers to process.

Response

array

request

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

request(string method, \Joomla\Uri\UriInterface uri, mixed data = null, array headers = [], int timeout = null, string userAgent = null) : \Joomla\Http\Response
since

1.0

throws

\RuntimeException

Arguments

method

stringThe HTTP method for sending the request.

uri

\Joomla\Uri\UriInterfaceThe URI to the resource to request.

data

mixedEither an associative array or a string to be sent with the request.

headers

arrayAn array of request headers to send with the request.

timeout

intRead timeout in seconds.

userAgent

stringThe optional user agent string to send with the request.

Response

\Joomla\Http\Response

Properties

options

The client options.

inherited
since

2.0.0

Type(s)

array|\ArrayAccess