![]() |
LTI Integration Library
3.1.0
PHP class library for building LTI integrations
|
Class to represent an HTTP message request. More...
Public Member Functions | |
| __construct ($url, $method='GET', $params=null, $header=null) | |
| Class constructor. More... | |
| getUrl () | |
| Get the target URL for the request. More... | |
| getMethod () | |
| Get the HTTP method for the request. More... | |
| send () | |
| Send the request to the target URL. More... | |
Static Public Member Functions | |
| static | setHttpClient ($httpClient=null) |
| Set the HTTP client to use for sending the message. More... | |
| static | getHttpClient () |
| Get the HTTP client to use for sending the message. More... | |
Data Fields | |
| $ok = false | |
| True if message was processed successfully. More... | |
| $request = null | |
| Request body. More... | |
| $requestHeaders = '' | |
| Request headers. More... | |
| $response = null | |
| Response body. More... | |
| $responseHeaders = '' | |
| Response headers. More... | |
| $status = 0 | |
| Status of response (0 if undetermined). More... | |
| $error = '' | |
| Error message. More... | |
Class to represent an HTTP message request.
Definition at line 16 of file HTTPMessage.php.
| __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) |
Definition at line 97 of file HTTPMessage.php.
|
static |
Get the HTTP client to use for sending the message.
If one is not set, a default client is created.
Definition at line 146 of file HTTPMessage.php.
Referenced by HTTPMessage\send().
| getMethod | ( | ) |
Get the HTTP method for the request.
Definition at line 126 of file HTTPMessage.php.
Referenced by CurlClient\send(), and StreamClient\send().
| getUrl | ( | ) |
Get the target URL for the request.
Definition at line 116 of file HTTPMessage.php.
Referenced by CurlClient\send(), and StreamClient\send().
| send | ( | ) |
Send the request to the target URL.
Definition at line 164 of file HTTPMessage.php.
References HTTPMessage\$ok, and HTTPMessage\getHttpClient().
|
static |
Set the HTTP client to use for sending the message.
| Http\ClientInterface | null | $httpClient |
Definition at line 136 of file HTTPMessage.php.
| string $error = '' |
Error message.
Definition at line 66 of file HTTPMessage.php.
| bool $ok = false |
True if message was processed successfully.
Definition at line 24 of file HTTPMessage.php.
Referenced by HTTPMessage\send().
| string null $request = null |
Request body.
Definition at line 31 of file HTTPMessage.php.
| string array $requestHeaders = '' |
Request headers.
Definition at line 38 of file HTTPMessage.php.
| string null $response = null |
Response body.
Definition at line 45 of file HTTPMessage.php.
| string array $responseHeaders = '' |
Response headers.
Definition at line 52 of file HTTPMessage.php.
| int $status = 0 |
Status of response (0 if undetermined).
Definition at line 59 of file HTTPMessage.php.