В одной из моих функций я отправляю два запроса curl отдельно, а во второй я получаю текстовый ответ ответа.Вот код запроса:
//Initialize the curl connection
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->_endpoint);
curl_setopt($ch, CURLOPT_HEADER, 0); //No header in the response
curl_setopt($ch, CURLOPT_POST, 1); //Submit through post
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); //Post data
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); //New connection every time
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Get response data
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); //Security...
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
//Get a response.
if ( !$response_data = curl_exec($ch) ){
$this->_error ( curl_error ( $ch ) );
curl_close($ch);
return FALSE;
}
//Decode our response
parse_str ( $response_data, $response );
//Close curl
curl_close($ch);
Если я сделаю только один звонок, все будет хорошо.Когда я делаю второй звонок, я получаю текстовый вывод в своем браузере, например:
username=my_username&password=my_password&email=my_email%40gmail.com
Есть идеи?