SocketTransport
Extends AbstractTransport Implements TransportInterfaceHTTP transport class for using sockets directly.
since |
1.7.3 |
---|---|
package |
Joomla CMS |
Methods
connect
Method to connect to a server and get the resource.
connect(\Joomla\Uri\UriInterface uri, timeout = null) :
since |
1.7.3 |
---|---|
throws |
|
Arguments
- uri
UriInterface
The URI to connect with.- timeout
int
Read timeout in seconds.
Response
resource
Socket connection resource.
getResponse
Method to get a response object from a server response.
getResponse( content) : \Joomla\CMS\Http\Response
since |
1.7.3 |
---|---|
throws |
|
Arguments
- content
string
The complete server response, including headers.
Response
isSupported
Method to check if http transport socket available for use
isSupported() :
since |
3.0.0 |
---|
Response
bool
True 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
since |
1.7.3 |
---|---|
throws |
|
Arguments
- method
string
The HTTP method for sending the request.- 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<string|int, mixed>
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
Properties
connections
Reusable socket connections.
since |
1.7.3 |
---|
Type(s)
array<string|int, mixed>