como envio essa requisição?
salvee developers, estou com uma dificuldade para enviar uma requisição, oque a acontece é que a mesma nao contem um POST DATA e sim um REQUEST PAYLOAD, dei uma pesquisada sobre isso e vi que se trata de uma requisição json, tentei fazer mas nao funciona. deem uma olhada no codigo
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www. .... .com.br/confirmacao-de-token/");
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array(
'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding:gzip, deflate, br',
'Accept-Language:pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control:max-age=0',
'Connection:keep-alive',
'Content-Length: 68000',
'Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryz5dXTWvoBeebTUA1',
'Host:www.consumidorpositivo.com.br',
'Origin:https://www. .... .com.br',
'Referer:https://www. ..... .com.br/confirmacao-de-token/',
'Upgrade-Insecure-Requests:1',
'User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36')
);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/cookie');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '------WebKitFormBoundaryGmZ72mfkXFaxUCoc
Content-Disposition: form-data; name="input_1"
sdgsdfgsdggsdf
------WebKitFormBoundaryGmZ72mfkXFaxUCoc
Content-Disposition: form-data; name="is_submit_9"
1
------WebKitFormBoundaryGmZ72mfkXFaxUCoc
Content-Disposition: form-data; name="gform_submit"
9
------WebKitFormBoundaryGmZ72mfkXFaxUCoc
Content-Disposition: form-data; name="gform_unique_id"
------WebKitFormBoundaryGmZ72mfkXFaxUCoc
Content-Disposition: form-data; name="state_9"
WyJbXSIsImYwYjQzMWI1ODlkMzdmZTRhOGNiZTM3NmJkNWZkNDFjIl0=
------WebKitFormBoundaryGmZ72mfkXFaxUCoc
Content-Disposition: form-data; name="gform_target_page_number_9"
0
------WebKitFormBoundaryGmZ72mfkXFaxUCoc
Content-Disposition: form-data; name="gform_source_page_number_9"
1
------WebKitFormBoundaryGmZ72mfkXFaxUCoc
Content-Disposition: form-data; name="gform_field_values"
------WebKitFormBoundaryGmZ72mfkXFaxUCoc--');
$dados = curl_exec($ch);
echo $dados;
se alguem puder me ajudar com isso eu agradeço muitoDiscussão (0)
Carregando comentários...