composer fix.
Minor enhancement to namespacing
Unirest\Request\Body::Form for constructing application/x-www-form-urlencoded request bodiesUnirest\Request\Body::Json for constructing application/json request bodiesUnirest\Request\Body::Multipart($dat, $files) for constructing multipart/form-data request bodies and file uploadsUnirest\Request\Body::File for single file upload parameter constructionUnirest\FilePlease Review the README for the updated API.
updated PHPDoc
Fixed: setting of default headers array #89
improved solution to override cURL options
allow to override default curlopts
update phpdoc return values.
disable SSL host verification with helper method: Unirest\Request::verifyHost(false)
ability to set custom curl options:
Unirest\Request::curlOpt()Unirest\Request::curlOpts()Unirest\Request::clearCurlOpts()New Utility Methods
Unirest\Request::getCurlHandle()Unirest\Request::getInfo() for debugging failed requestsPHP 5.4 lacks support for CURLOPT_USERNAME and CURLOPT_PASSWORD
Advanced Authentication Methods
Unirest\Request::auth($username, $password = '', $method = CURLAUTH_BASIC);
Supports Basic, Digest, Negotiate, NTLM Authentication natively, see README for more details.
Proxy Support
Unirest\Request::proxy($address, $port = 1080, $type = CURLPROXY_HTTP, $tunnel = false);
proxy port defaults to 1080 as per cURL defaults
check the cURL docs for more info on tunneling.
proxy type to be one of CURLPROXY_HTTP, CURLPROXY_HTTP_1_0, CURLPROXY_SOCKS4, CURLPROXY_SOCKS5, CURLPROXY_SOCKS4A, and CURLPROXY_SOCKS5_HOSTNAME.
check the cURL docs for more info.
full usage example:
// quick setup with default port: 1080
Unirest\Request::proxy('10.10.10.1');
// custom port and proxy type
Unirest\Request::proxy('10.10.10.1', 8080, CURLPROXY_HTTP);
// enable tunneling
Unirest\Request::proxy('10.10.10.1', 8080, CURLPROXY_HTTP, true);
Proxy Authentication
Unirest\Request::proxyAuth($username, $password = '', $method = CURLAUTH_BASIC);
Supports Basic, Digest, Negotiate, NTLM Authentication natively, see README for more details.
Unirest\Request::sendUnirest\Request::jsonOpts() method.Unirest\Request::defaultHeaders()Cleanups & Updates
Unirest\File::add signature to follow after curl_file_create with fallbackBreaking Changes
src and tests as per phpunit standard tree structureUnirest\Request, Unirest\Response, Unirest\Method, Unirest\FileHow can I help you explore Laravel packages today?