function httprl_override_core in HTTP Parallel Request & Threading Library 6
Same name and namespace in other branches
- 7 httprl.module \httprl_override_core()
Queue and send off http request.
This is a flexible and powerful HTTP client implementation. Correctly handles GET, POST, PUT or any other HTTP requests.
Parameters
string $url: A string containing a fully qualified URI.
array $options: (optional) An array of options.
Return value
object The request object.
See also
2 string references to 'httprl_override_core'
- httprl_admin_settings_form in ./
httprl.admin.inc - Form definition; general settings.
- httprl_admin_settings_form_validate in ./
httprl.admin.inc - Validate form values.
File
- ./
httprl.module, line 254 - HTTP Parallel Request Library module.
Code
function httprl_override_core($url, $options = array()) {
// Clear out older requests if needed.
httprl_send_request();
// Queue up the request.
httprl_request($url, $options);
// Execute request.
$response = httprl_send_request();
// Send back results.
return is_array($response) && is_string($url) && array_key_exists($url, $response) ? $response[$url] : is_array($response) ? array_pop($response) : $response;
}