@Mile4311112

Почему не отправляет CURL?

$url = 'https://crm...'. http_build_query($postData);

    //Setup cURL
    $ch = curl_init();

    //The site we'll be sending the POST data to.
    curl_setopt($ch, CURLOPT_URL, $url);

    //Tell cURL that we want to send a POST request.
    // curl_setopt($ch, CURLOPT_POST, TRUE);
    curl_setopt($ch, CURLOPT_HTTPGET, TRUE);
	curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');

    //Attach our POST data.
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);

    //Tell cURL that we want to receive the response that the site
    //gives us after it receives our request.
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, TRUE);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);

    //Finally, send the request.
    curl_exec($ch);

    $url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
    $error['url']=$url;
    //Close the cURL session
    curl_close($ch);
  • Вопрос задан
  • 154 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
11 мая 2024, в 00:19
1000 руб./за проект
10 мая 2024, в 23:51
30000 руб./за проект
10 мая 2024, в 23:33
2500 руб./за проект