I have major problem while getting response. I am using drupal_http_request to get the response but I get 400 as response though url given is working... I tried Curl Http Request module to overrride drupal_http_request. If i do that, then I get response code as 47 and error is maximum redirect followed. If I dont use CHR module, then error is 400 but through fiddler, or by POSTMAN, response is 200Ok.. Any help on this?
Below is my code
$url = "https://lastpass.com/misc_download2.php"; $options = array( 'max_redirects' => 20, 'headers' => array( 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36', ) ); $check_url = drupal_http_request($url, $options);
print_r($check_url) is giving code=400