SocketTransport

Extends AbstractTransport Implements TransportInterface

HTTP transport class for using sockets directly.

deprecated
since

1.7.3

deprecated

6.0.0 will be removed in 7.0 Use Joomla\Http\Transport\Socket instead

package

Joomla CMS

Methods

connect

Method to connect to a server and get the resource.

connect(\Joomla\Uri\UriInterface uri,  timeout = null) : 
deprecated
throws

RuntimeException

since

1.7.3

deprecated

6.0.0 will be removed in 7.0 Use Joomla\Http\Transport\Socket::connect() instead

Arguments

uri

UriInterfaceThe URI to connect with.

timeout

intRead timeout in seconds.

Response

resourceSocket connection resource.

getResponse

Method to get a response object from a server response.

getResponse( content) : \Joomla\CMS\Http\Response
deprecated
throws

InvalidResponseCodeException

since

1.7.3

deprecated

6.0.0 will be removed in 7.0 Use Joomla\Http\Transport\Socket::getResponse() instead

Arguments

content

stringThe complete server response, including headers.

Response

Response

isSupported

Method to check if http transport socket available for use

isSupported() : 
static deprecated
since

3.0.0

deprecated

6.0.0 will be removed in 7.0 Use Joomla\Http\Transport\Socket::isSupported() instead

Response

boolTrue if available else false

request

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

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

RuntimeException

since

1.7.3

deprecated

6.0.0 will be removed in 7.0 Use Joomla\Http\Transport\Socket::request() instead

Arguments

method

stringThe HTTP method for sending the request.

uri

UriInterfaceThe URI to the resource to request.

data

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

headers

array<string|int, mixed>An 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

Response

Properties

connections

Reusable socket connections.

since

1.7.3

Type(s)

array<string|int, mixed>