Class to represent an HTTP message request. More...
Public Member Functions | |
| __construct ($url, $method='GET', $params=null, $header=null) | |
| Class constructor. | |
| string | getUrl () |
| Get the target URL for the request. | |
| string | getMethod () |
| Get the HTTP method for the request. | |
| bool | send () |
| Send the request to the target URL. | |
| bool | hasRelativeLink ($rel) |
| Check whether a relative link of the specified type exists. | |
| string null | getRelativeLink ($rel) |
| Get the URL from the relative link with the specified type. | |
| array | getRelativeLinks () |
| Get the relative links. | |
Static Public Member Functions | |
| static void | setHttpClient ($httpClient=null) |
| Set the HTTP client to use for sending the message. | |
| static ClientInterface null | getHttpClient () |
| Get the HTTP client to use for sending the message. | |
Public Attributes | |
| bool | $ok = false |
| True if message was processed successfully. | |
| string null | $request = null |
| Request body. | |
| string array | $requestHeaders = '' |
| Request headers. | |
| string null | $response = null |
| Response body. | |
| string array | $responseHeaders = '' |
| Response headers. | |
| array | $relativeLinks = array() |
| Relative links in response headers. | |
| int | $status = 0 |
| Status of response (0 if undetermined). | |
| string | $error = '' |
| Error message. | |
Class to represent an HTTP message request.
| __construct | ( | $url, | |
$method = 'GET', |
|||
$params = null, |
|||
$header = null |
|||
| ) |
Class constructor.
| string | $url | URL to send request to |
| string | $method | Request method to use (optional, default is GET) |
| mixed | $params | Associative array of parameter values to be passed or message body (optional, default is none) |
| string | $header | Values to include in the request header (optional, default is none) |
Reimplemented in HTTPMessage.
|
static |
Get the HTTP client to use for sending the message.
If one is not set, a default client is created.
References Util\logDebug().
| string getMethod | ( | ) |
Get the HTTP method for the request.
Referenced by StreamClient\send().
| string null getRelativeLink | ( | $rel | ) |
Get the URL from the relative link with the specified type.
| string | $rel |
| array getRelativeLinks | ( | ) |
Get the relative links.
| string getUrl | ( | ) |
| bool hasRelativeLink | ( | $rel | ) |
Check whether a relative link of the specified type exists.
| string | $rel |
| bool send | ( | ) |
Send the request to the target URL.
|
static |
Set the HTTP client to use for sending the message.
| ClientInterface | null | $httpClient |
| string $error = '' |
Error message.
$error
| bool $ok = false |
True if message was processed successfully.
$ok
| array $relativeLinks = array() |
Relative links in response headers.
$relativeLinks
| string null $request = null |
Request body.
$request
| string array $requestHeaders = '' |
Request headers.
$requestHeaders
| string null $response = null |
Response body.
$response
| string array $responseHeaders = '' |
Response headers.
$responseHeaders
| int $status = 0 |
Status of response (0 if undetermined).
$status