I'm trying to GET a result via jira REST API using php, but I'm getting unexpected results. When I punch the following URL: http://localhost:8080/rest/api/2/project/ABCD/components directly on the browser I get a result(it works), but when I do it via php I get the following error:
string(76) "{"errorMessages":["No project could be found with key 'RELM'."],"errors":{}}"
the following is the php code:
$key = trim('RELM');
$ch = curl_init();
$url = "http://localhost:8080/rest/api/2/project/$key/components";
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
// curl_setopt($ch,CURLOPT_HEADER, false);
$output=curl_exec($ch);
curl_close($ch);
var_dump($output) ;