Examples from #1420104: Logic is broken with redirects are still broken:

function httprl_admin_settings_form() {

  $headers = array();
  $headers['User-Agent'] = 'User-Agent: Drupal (+http://drupal.org/)';

  // Add in the headers and enable blocking mode.
  $options = array(
    'blocking' => TRUE,
    'headers' => $headers,
    'method' => 'HEAD',
    'max_redirects' => 1,
  );

  // Queue up the requests.
  httprl_request('http://jyaml.de', $options);
  httprl_request('http://www.jyaml.de', $options);

  // Execute requests.
  $responses = httprl_send_request();
  foreach ($responses as $response) {
    krumo($response);
  }

  // Compare to core:
  krumo(drupal_http_request('http://jyaml.de', $options));
  krumo(drupal_http_request('http://www.jyaml.de', $options));

Comments

hass’s picture

Version: 7.x-1.x-dev » 7.x-1.4
hass’s picture

Status: Active » Closed (duplicate)