I want to cURL the following request in PHP:
curl --location --request GET 'xxx.xxxxxad.com/api/rest/issues?project_id=4' -H 'Authorization:xxxxxxxxxxxxxxxxxxxxxxxxxxxHTb'
The code that I implemented was:
<?php
$url = "xxx.xxxxxad.com/api/rest/issues?project_id=4";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, array('Authorization:xxxxxxxxxxxxxxxxxxxxxxxxxxxHTb'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
echo $output;
curl_close($ch);
?>
I cannot find a way to include --location
in the request without which the data cannot be fetched.