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,
  );

  $urls = array(
  	'http://www.neuland.com/sucht.htm',
  );

  foreach ($urls as $url) {
    // Queue up the requests.
    httprl_request($url, $options);

    // Compare to core:
    krumo(drupal_http_request($url, $options));
  }

  // Execute requests.
  $responses = httprl_send_request();
  foreach ($responses as $response) {
    krumo($response);
  }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Core request:
HEAD /sucht.htm HTTP/1.0 User-Agent: User-Agent: Drupal (+http://drupal.org/) Host: www.neuland-world.com

HTTPRL request:
HEAD /sucht.htm HTTP/1 User-Agent: User-Agent: Drupal (+http://drupal.org/) Host: www.neuland.com Connection: close

hass’s picture

hass’s picture

Status: Active » Needs review
FileSize
563 bytes

Here is a patch to fix the "505 HTTP Version Not Supported" problem, because of the float not recognized as string.

hass’s picture

This one is more reliable.

hass’s picture

Title: "505 HTTP Version Not Supported", but core/wget returns "301 Moved Temporarily" » Improperly formatted HTTP version cause very many malfunctions
mikeytown2’s picture

Status: Needs review » Fixed

Going to use both patches. Both have been committed. Big thanks for tracking this one down!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.