Method | Description | |
---|---|---|
__construct ( string $url, string $method = 'GET', integer $timeout = 180 ) | ||
__set_processor ( $processor ) | DO NOT USE THIS FUNCTION. | |
add_header ( mixed $header ) | Add a request header. | |
add_headers ( array $headers ) | Add a list of headers. | |
execute ( ) | Actually execute the request. | |
executed ( ) | ||
get_contents ( string $url, boolean $use_include_path = false, resource $context = null, integer $offset, integer $maxlen ) : string | Static helper function to quickly fetch an URL, with semantics similar to PHP's file_get_contents. Does not support | |
get_response_body ( ) | Return the response body. Raises a warning and returns '' if the request wasn't executed yet. | |
get_response_headers ( ) | Return the response headers. Raises a warning and returns '' if the request wasn't executed yet. | |
set_body ( string $body ) | Set the request body. | |
set_config ( mixed $config, mixed $value = null ) | Set adapter configuration options | |
set_file ( string $name, string $filename, string $content_type = null, null $override_filename = null ) | set file | |
set_params ( array $params ) | Set the request query parameters (i.e., the URI's query string). | |
set_postdata ( mixed $name, string $value = null ) | set postdata | |
set_timeout ( integer $timeout ) | Set the timeout. |
Method | Description | |
---|---|---|
__filter ( $data, $url ) | Call the filter hook. | |
merge_query_params ( string $url, string $params ) | Merge query params from the URL with given params. | |
prepare ( ) | A little housekeeping. | |
strip_anchors ( $url ) | Remove anchors (#foo) from given URL. |
public __set_processor ( $processor ) |
public add_header ( mixed $header ) | ||
$header | mixed | The header to add, either as a string 'Name: Value' or an associative array 'name'=>'value' |
public add_headers ( array $headers ) | ||
$headers | array | List of headers to add. |
public execute ( ) |
public static get_contents ( string $url, boolean $use_include_path = false, resource $context = null, integer $offset, integer $maxlen ) : string | ||
$url | string | The URL to fetch |
$use_include_path | boolean | whether to search the PHP include path first (unsupported) |
$context | resource | a stream context to use (unsupported) |
$offset | integer | how many bytes to skip from the beginning of the result |
$maxlen | integer | how many bytes to return |
return | string | description |
public get_response_body ( ) |
public get_response_headers ( ) |
public set_config ( mixed $config, mixed $value = null ) | ||
$config | mixed | An array of options or a string name with a corresponding $value |
$value | mixed |
public set_params ( array $params ) | ||
$params | array |
public set_postdata ( mixed $name, string $value = null ) | ||
$name | mixed | |
$value | string |
public set_timeout ( integer $timeout ) | ||
$timeout | integer | Timeout in seconds |