Answer the question
In order to leave comments, you need to log in
How to get cURL request result like in Raw tab in Postman?
I make a request in Postman The result in the Raw
tab looks like this:
And in the Preview tab it looks like this :
And when I copy the cURL-PHP code on the right:
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://my-url',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'property_id%5B%5D=bf7bdcbc-83e5-4fba-b3a9-bc0f97f222f5',
CURLOPT_HTTPHEADER => array(
'Content-type: application/x-www-form-urlencoded',
'Authorization: Basic YzJjN2Q1NTYtMTg2Ny01MmExLTg0ZDYtMzUyMTVlY2Y2ZTUzOjlkMGViNWVjLTdhNTYtNTA4Ny1hODI1LWMyODFhYTEzYzBkYw=='
),
));
$response = curl_exec($curl);
curl_close($curl);
echo "<pre>";
print_r($response);
Answer the question
In order to leave comments, you need to log in
In the browser, click view page code. You display html tags from the response of another server, the browser thinks that this is the layout of your site
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question