Получение ответа http 405 путем отправки с использованием php curl

Я пытаюсь создать пользователя Uber, отправив данные в форме по адресу:
https://get.uber.com/new-signup/

Мой код:

<?php
function alpha($len) {
$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randstring = '';
for ($i = 1; $i <= $len; $i++) {
$randstring = $randstring.$characters[rand(0, strlen($characters))];
}
return $randstring;

}

function alpharnd() {

return alpha(8)."-".alpha(4)."-".alpha(4)."-".alpha(4)."-".alpha(12);
}

$post_data['signup_form'] = 'web_signup_new';
$post_data['country_code'] = 'CA';
$post_data['language'] = 'en_US';
$post_data['client_id'] = '';
$post_data['signup_type'] = 'organic';
$post_data['signup_session_id'] = alpharnd();
$post_data['skip_signup_sms'] = 'True';

$post_data['first_name'] = 'Sanjay';
$post_data['last_name'] = 'Das';
$post_data['mobile_country'] = 'IN';
$post_data['mobile'] = '*****';
$post_data['email'] = '*****';
$post_data['password'] = '*****';
$post_data['promotion_code'] = '';$url = 'http://get.uber.com/signup_submit/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.4");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, true);    // we don't need body
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);

echo "<hr>";
echo 'HTTP code: ' . $httpcode;
echo "<hr>";
print_r($info);
echo "<hr>";
print_r($post_data);
echo "<hr>";
?>

Я получаю следующий вывод:

HTTP code: 405
Array ( [url] => https://get.uber.com/signup_submit/ [content_type] => text/html [http_code] => 405 [header_size] => 540 [request_size] => 515 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 1 [total_time] => 1.849064 [namelookup_time] => 0.810126 [connect_time] => 1.065471 [pretransfer_time] => 1.590718 [size_upload] => 0 [size_download] => 178 [speed_download] => 96 [speed_upload] => 0 [download_content_length] => 178 [upload_content_length] => 0 [starttransfer_time] => 1.84903 [redirect_time] => 0.805986 [redirect_url] => [primary_ip] => 104.36.192.180 [certinfo] => Array ( ) [primary_port] => 443 [local_ip] => 103.21.59.198 [local_port] => 46643 )
Array ( [signup_form] => web_signup_new [country_code] => CA [language] => en_US [client_id] => [signup_type] => organic [signup_session_id] => HIB7CN8M-2OK2-DJC-OTE1-3WZP3XXC03T [skip_signup_sms] => True [first_name] => Sanjay [last_name] => Das [mobile_country] => IN [mobile] => 8732311456 [email] => [email protected] [password] => ggg1234fgtrf [promotion_code] => )

Где я делаю неправильно ??? Я получаю код HTTP: 405

Пожалуйста, порекомендуйте….

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]