Method | Description | |
---|---|---|
__construct ( null $base_url = '' ) | Public constructor | |
__destruct ( ) | Class destructor cleans up any resources | |
content_mime_type ( $content ) : void | ||
data ( ) | Set a variable (query param or a data var) | |
delete ( $uri ) | HTTP DELETE | |
file_mime_type ( $path ) : void | ||
get ( $uri ) | HTTP GET | |
head ( $uri ) | HTTP HEAD | |
header ( ) | Set an HTTP Head | |
method ( $method ) : |
Set HTTP method to use with send() | |
param ( ) | Set a query param. This method can/should not be used with HTTP GET! Use var() call instead or you will get an exception | |
post ( $uri ) | HTTP POST | |
put ( $uri ) | HTTP PUT | |
send ( $uri ) | Custom HTTP Method. Use with caution. | |
timeout ( $ms ) | Set curl/http timeout in milliseconds. |
Method | Description | |
---|---|---|
_http_parse_headers ( $header ) : array | Backup PHP impl. for when PECL http_parse_headers() function is not available | |
check_status ( $response, $full_url ) | Check http status for safe return codes | |
get_full_url ( $uri ) | Get full URL from a partial one | |
http_request ( $http_method, $uri, array $data = [] ) | Generic implementation of a HTTP Request. |
public __construct ( null $base_url = '' ) | ||
$base_url | null |
public content_mime_type ( $content ) : void | ||
$content | content of a file in a string buffer format. | |
return | void |
public file_mime_type ( $path ) : void | ||
$path | Full path to a file (e.g. as returned by PHP's realpath function). | |
return | void |
public method ( $method ) : |
||
$method | ||
return |
public param ( ) |