Answer the question
In order to leave comments, you need to log in
Interpreting CURL results, how?
Good day to all. Faced with an interesting situation, I would like your help.
I'm just starting to delve into Web programming (experience no more than 4 months), doing everything I have to do (layout, js, php, etc.).
Essence of the question.
I have the following php code:
<?php
$ch = curl_init();
$url="url скрыт";
$param="{\r\n\"Request_id\": \"необходимый id\",\r\n\"Method\": \"getCities\",\r\n\"Parameters\": {\r\n}\r\n}\r\n";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$param);
// curl_setopt($ch, CURLOPT_CERTINFO,true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD,"login:password");
curl_setopt($ch, CURLOPT_COOKIEFILE,"cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEJAR,"cookie.txt");
$result = curl_exec($ch);
var_dump($result);
curl_close($ch);
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question