This is a module intended for developers, as it provides just one API to call:
curl_http_request() for versions 1.5 and earlier).
chr_curl_http_request() is an alternative implementation of Drupal core function
drupal_http_request() using cURL.
The function intends to be backwards compatible with
drupal_http_request(), by accepting the same parameters in the same form and by returning the response in the same format.
Debug HTTP requests (v1.6 and higher)
dpm() print-outs of HTTP requests/response objects by enabling Devel and the debug mode in the cURL HTTP Request administrative section.
cURL HTTP request does provide some extra features, though: it allows for requests to be sent via proxy, whether they are HTTP or HTTPS request. It can even support different proxies for HTTP and HTTPS. Basic proxy authentication via username and password is also supported as well as an exception list of hostnames not to be contacted via proxy.
Sample proxy settings
An example of the proxy configuration that you must add to your
settings.php in order to have proxy support in your request via
/** * External access proxy settings: * * If your site must access the Internet via a web proxy then you can enter * the proxy settings here. Currently only basic authentication is supported * by using the username and password variables. The 'exceptions' variable * is an array of host names to be accessed directly, not via proxy. */ // As of version 1.7, the following settings is no longer mandatory. // When not specified, 'chr' will leverage Drupal proxy settings // (see http://git.io/vU8Af) and use them for both HTTP and HTTPS. $conf['http_proxy'] = array( 'server' => 'your.proxy.com', 'port' => '8080', 'username' => 'user', 'password' => 'pass', 'exceptions' => array('localhost'), ); // As of version 1.7, the following it's assumed by default and // you can omit this line. If you haven't set 'http_proxy', 'chr' will // fall back on Drupal proxy settings and use the same settings // for both HTTP and HTTPS. $conf['https_proxy'] = $conf['http_proxy'];
Drupal 7 specific features
Automatic override of
drupal_http_request() (v1.6 and higher)
As of Drupal 7.21 you can register an alternative HTTP request function. Using the administrative section
admin/config/services/chr you can set
chr_curl_http_request() as the default method.
Compatibility with the RESTClient module
RESTClient depends on chr to make HTTP requests for REST services.
- Maintenance status: Actively maintained
- Development status: Under active development
- Reported installs: 3,250 sites currently report using this module. View usage statistics.
- Downloads: 55,381
- Last modified: 4 December 2015
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.