Class MOXMAN_Http_HttpClientRequest
Inheritance | MOXMAN_Http_HttpClientRequest |
---|
This class represents the HTTP request from a MOXMAN_Http_HttpClient instance.
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Constructs a new HTTP client request instance. | MOXMAN_Http_HttpClientRequest |
getHeader() | Returns a specific header by name to be sent to the server. | MOXMAN_Http_HttpClientRequest |
getHeaders() | Returns all http headers as an array. | MOXMAN_Http_HttpClientRequest |
getMethod() | Returns the request method like get/post/head etc. | MOXMAN_Http_HttpClientRequest |
getUrl() | Returns the URL instance containing path, host, query etc. | MOXMAN_Http_HttpClientRequest |
send() | Sends the specified HTTP request to server and returns a HTTP response object. | MOXMAN_Http_HttpClientRequest |
setAuth() | Sets http basic auth authentication data | MOXMAN_Http_HttpClientRequest |
setHeader() | Sets a specific header by name to be sent to the server. | MOXMAN_Http_HttpClientRequest |
setLocalFile() | Sets a local file path to stream as content body of request. | MOXMAN_Http_HttpClientRequest |
setQuery() | Sets the query string to a raw string or a name/value array. | MOXMAN_Http_HttpClientRequest |
Method Details
Constructs a new HTTP client request instance.
public void __construct ( $client, $url, $method ) | ||
$client | MOXMAN_Http_HttpClient | HTTP client instance to connect to request. |
$url | Array | Url object that contains the host, port, path, querystring etc. |
$method | string | Request method head/get/post. |
Returns a specific header by name to be sent to the server.
public \String/Array getHeader ( $name, $default = "" ) | ||
$name | string | Name of the specified header to get. |
$default | ||
return | \String/Array | $value Value or multiple values if multiple headers of the same name is to be sent. |
---|
Returns all http headers as an array.
public Array getHeaders ( ) | ||
return | Array | Name/value array with all HTTP headers. |
---|
Returns the request method like get/post/head etc.
public String getMethod ( ) | ||
return | String | Http request method. |
---|
Returns the URL instance containing path, host, query etc.
public Array getUrl ( ) | ||
return | Array | Name/value array with url items. |
---|
Sends the specified HTTP request to server and returns a HTTP response object.
public MOXMAN_Http_HttpClientResponse send ( $data = null ) | ||
$data | ||
return | MOXMAN_Http_HttpClientResponse | HTTP client response instance. |
---|
Sets http basic auth authentication data
public void setAuth ( $user, $password ) | ||
$user | string | |
$password | string |
Sets a specific header by name to be sent to the server.
public void setHeader ( $name, $value ) | ||
$name | string | Name of the specified header to set. |
$value | \String/Array | Value or multiple values if multiple headers of the same name is to be sent. |
Sets a local file path to stream as content body of request.
public void setLocalFile ( $localFilePath ) | ||
$localFilePath | string | Local file path to send as binary stream. |
Sets the query string to a raw string or a name/value array.
public \Instance setQuery ( $query ) | ||
$query | \String/Array | Query string or array to set. |
return | \Instance | Of http request. |
---|