Method | Description | |
---|---|---|
auth ( string $username = '', string $password = '', integer $method = CURLAUTH_BASIC ) | Set authentication method to use | |
buildHTTPCurlQuery ( array | object $data, boolean | string $parent = false ) : array | This function is useful for serializing multidimensional arrays, and avoid getting the 'Array to string conversion' notice | |
clearCurlOpts ( ) | Clear all the default headers | |
clearDefaultHeaders ( ) | Clear all the default headers | |
connect ( string $url, array $headers = [], mixed $parameters = null, string $username = null, string $password = null ) : unirest\Response | Send a CONNECT request to a URL | |
cookie ( string $cookie ) | Set a cookie string for enabling cookie handling | |
cookieFile ( string $cookieFile ) | Set a cookie file path for enabling cookie handling | |
curlOpt ( string $name, string $value ) : string | Set a new default header to send on every request | |
curlOpts ( array $options ) : array | Set curl options to send on every request | |
defaultHeader ( string $name, string $value ) : string | Set a new default header to send on every request | |
defaultHeaders ( array $headers ) : array | Set default headers to send on every request | |
delete ( string $url, array $headers = [], mixed $body = null, string $username = null, string $password = null ) : unirest\Response | Send DELETE request to a URL | |
get ( string $url, array $headers = [], mixed $parameters = null, string $username = null, string $password = null ) : unirest\Response | Send a GET request to a URL | |
getCurlHandle ( ) | ||
getFormattedHeaders ( $headers ) | ||
getInfo ( $opt = false ) | ||
head ( string $url, array $headers = [], mixed $parameters = null, string $username = null, string $password = null ) : unirest\Response | Send a HEAD request to a URL | |
jsonOpts ( boolean $assoc = false, integer $depth = 512, integer $options ) : array | Set JSON decode mode | |
options ( string $url, array $headers = [], mixed $parameters = null, string $username = null, string $password = null ) : unirest\Response | Send a OPTIONS request to a URL | |
patch ( string $url, array $headers = [], mixed $body = null, string $username = null, string $password = null ) : unirest\Response | Send PATCH request to a URL | |
post ( string $url, array $headers = [], mixed $body = null, string $username = null, string $password = null ) : unirest\Response | Send POST request to a URL | |
proxy ( string $address, integer $port = 1080, integer $type = CURLPROXY_HTTP, boolean $tunnel = false ) | Set proxy to use | |
proxyAuth ( string $username = '', string $password = '', integer $method = CURLAUTH_BASIC ) | Set proxy authentication method to use | |
put ( string $url, array $headers = [], mixed $body = null, string $username = null, string $password = null ) : unirest\Response | Send PUT request to a URL | |
send ( Unirest\Method | string $method, string $url, mixed $body = null, array $headers = [], string $username = null, string $password = null ) : unirest\Response | Send a cURL request | |
setMashapeKey ( string $key ) : string | Set a Mashape key to send on every request as a header Obtain your Mashape key by browsing one of your Mashape applications on https://www.mashape.com | |
timeout ( integer $seconds ) : integer | Set a timeout | |
trace ( string $url, array $headers = [], mixed $body = null, string $username = null, string $password = null ) : unirest\Response | Send TRACE request to a URL | |
verifyHost ( boolean $enabled ) : boolean | Verify SSL host | |
verifyPeer ( boolean $enabled ) : boolean | Verify SSL peer |
Method | Description | |
---|---|---|
encodeUrl ( string $url ) : string | Ensure that a URL is encoded and safe to use with cURL | |
getArrayFromQuerystring ( $query ) | ||
getHeaderString ( $key, $val ) | ||
mergeCurlOptions ( array &$existing_options, array $new_options ) : array |
public static clearDefaultHeaders ( ) |
public static connect ( string $url, array $headers = [], mixed $parameters = null, string $username = null, string $password = null ) : unirest\Response | ||
$url | string | URL to send the CONNECT request to |
$headers | array | additional headers to send |
$parameters | mixed | parameters to send in the querystring |
$username | string | Basic Authentication username (deprecated) |
$password | string | Basic Authentication password (deprecated) |
return | unirest\Response |
public static cookieFile ( string $cookieFile ) | ||
$cookieFile | string | - path to file for saving cookie |
public static defaultHeaders ( array $headers ) : array | ||
$headers | array | headers array |
return | array |
public static delete ( string $url, array $headers = [], mixed $body = null, string $username = null, string $password = null ) : unirest\Response | ||
$url | string | URL to send the DELETE request to |
$headers | array | additional headers to send |
$body | mixed | DELETE body data |
$username | string | Basic Authentication username (deprecated) |
$password | string | Basic Authentication password (deprecated) |
return | unirest\Response |
public static get ( string $url, array $headers = [], mixed $parameters = null, string $username = null, string $password = null ) : unirest\Response | ||
$url | string | URL to send the GET request to |
$headers | array | additional headers to send |
$parameters | mixed | parameters to send in the querystring |
$username | string | Authentication username (deprecated) |
$password | string | Authentication password (deprecated) |
return | unirest\Response |
public static head ( string $url, array $headers = [], mixed $parameters = null, string $username = null, string $password = null ) : unirest\Response | ||
$url | string | URL to send the HEAD request to |
$headers | array | additional headers to send |
$parameters | mixed | parameters to send in the querystring |
$username | string | Basic Authentication username (deprecated) |
$password | string | Basic Authentication password (deprecated) |
return | unirest\Response |
public static jsonOpts ( boolean $assoc = false, integer $depth = 512, integer $options ) : array | ||
$assoc | boolean | When TRUE, returned objects will be converted into associative arrays. |
$depth | integer | User specified recursion depth. |
$options | integer | Bitmask of JSON decode options. Currently only JSON_BIGINT_AS_STRING is supported (default is to cast large integers as floats) |
return | array |
public static options ( string $url, array $headers = [], mixed $parameters = null, string $username = null, string $password = null ) : unirest\Response | ||
$url | string | URL to send the OPTIONS request to |
$headers | array | additional headers to send |
$parameters | mixed | parameters to send in the querystring |
$username | string | Basic Authentication username |
$password | string | Basic Authentication password |
return | unirest\Response |
public static patch ( string $url, array $headers = [], mixed $body = null, string $username = null, string $password = null ) : unirest\Response | ||
$url | string | URL to send the PATCH request to |
$headers | array | additional headers to send |
$body | mixed | PATCH body data |
$username | string | Basic Authentication username (deprecated) |
$password | string | Basic Authentication password (deprecated) |
return | unirest\Response |
public static post ( string $url, array $headers = [], mixed $body = null, string $username = null, string $password = null ) : unirest\Response | ||
$url | string | URL to send the POST request to |
$headers | array | additional headers to send |
$body | mixed | POST body data |
$username | string | Basic Authentication username (deprecated) |
$password | string | Basic Authentication password (deprecated) |
return | unirest\Response | response |
public static proxy ( string $address, integer $port = 1080, integer $type = CURLPROXY_HTTP, boolean $tunnel = false ) | ||
$address | string | proxy address |
$port | integer | proxy port |
$type | integer | (Available options for this are CURLPROXY_HTTP, CURLPROXY_HTTP_1_0 CURLPROXY_SOCKS4, CURLPROXY_SOCKS5, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5_HOSTNAME) |
$tunnel | boolean | enable/disable tunneling |
public static put ( string $url, array $headers = [], mixed $body = null, string $username = null, string $password = null ) : unirest\Response | ||
$url | string | URL to send the PUT request to |
$headers | array | additional headers to send |
$body | mixed | PUT body data |
$username | string | Basic Authentication username (deprecated) |
$password | string | Basic Authentication password (deprecated) |
return | unirest\Response |
public static send ( Unirest\Method | string $method, string $url, mixed $body = null, array $headers = [], string $username = null, string $password = null ) : unirest\Response | ||
$method | Unirest\Method | string | HTTP method to use |
$url | string | URL to send the request to |
$body | mixed | request body |
$headers | array | additional headers to send |
$username | string | Authentication username (deprecated) |
$password | string | Authentication password (deprecated) |
return | unirest\Response |
public static setMashapeKey ( string $key ) : string | ||
$key | string | Mashape key |
return | string |
public static trace ( string $url, array $headers = [], mixed $body = null, string $username = null, string $password = null ) : unirest\Response | ||
$url | string | URL to send the TRACE request to |
$headers | array | additional headers to send |
$body | mixed | TRACE body data |
$username | string | Basic Authentication username (deprecated) |
$password | string | Basic Authentication password (deprecated) |
return | unirest\Response |
public static verifyHost ( boolean $enabled ) : boolean | ||
$enabled | boolean | enable SSL host verification, by default is true |
return | boolean |
public static verifyPeer ( boolean $enabled ) : boolean | ||
$enabled | boolean | enable SSL verification, by default is true |
return | boolean |