Socket
Extends AbstractTransportHTTP transport class for using sockets directly.
since |
1.0 |
---|---|
package |
Joomla Framework |
Methods
__construct
Constructor.
__construct(array|\ArrayAccess options = []) : mixed
since |
2.0.0 |
---|---|
throws |
|
Arguments
- options
array|\ArrayAccess
Client options array.
Response
mixed
connect
Method to connect to a server and get the resource.
connect(\Joomla\Uri\UriInterface uri, int timeout = null) : resource
since |
1.0 |
---|---|
throws |
|
Arguments
- uri
\Joomla\Uri\UriInterface
The URI to connect with.- timeout
int
Read timeout in seconds.
Response
resource
Socket connection resource.
getOption
Get an option from the HTTP transport.
getOption(string key, mixed default = null) : mixed
since |
2.0.0 |
---|
Arguments
- key
string
The name of the option to get.- default
mixed
The default value if the option is not set.
Response
mixed
The option value.
getResponse
Method to get a response object from a server response.
getResponse(string content) : \Joomla\Http\Response
since |
1.0 |
---|---|
throws |
|
Arguments
- content
string
The complete server response, including headers.
Response
\Joomla\Http\Response
isSupported
Method to check if http transport socket available for use
isSupported() : bool
since |
1.0 |
---|
Response
bool
True if available else false
processHeaders
Processes the headers from a transport's response data.
processHeaders(array headers) : array
since |
2.0.0 |
---|
Arguments
- headers
array
The 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 |
|
Arguments
- method
string
The HTTP method for sending the request.- uri
\Joomla\Uri\UriInterface
The URI to the resource to request.- data
mixed
Either an associative array or a string to be sent with the request.- headers
array
An array of request headers to send with the request.- timeout
int
Read timeout in seconds.- userAgent
string
The optional user agent string to send with the request.
Response
\Joomla\Http\Response
Properties
connections
Reusable socket connections.
since |
1.0 |
---|
Type(s)
array
options
The client options.
since |
2.0.0 |
---|
Type(s)
array|\ArrayAccess