Answers for "how to get response body from curl request on command line"

0

curl adding body

curl -X POST -H "Content-Type: text/plain" --data "this is raw data" http://78.41.xx.xx:7778/
Posted by: Guest on November-27-2020
1

php curl get response body

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$response = curl_exec($ch);
// Then, after your curl_exec call:
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$header = substr($response, 0, $header_size);
$body = substr($response, $header_size);
Posted by: Guest on December-18-2021

Code answers related to "how to get response body from curl request on command line"

Code answers related to "Javascript"

Browse Popular Code Answers by Language