Hi I am using the https://bitbucket.org/atlassianlabs/atlassian-oauth-examples/src/master/php/ for oAuth process and requests.
This is working fine and I am able to use the post and get requests.
But in this I am not sure how to build the attachment request.
The post request is something like which is working fine.
$headers_array = array("Content-Type"=> "application/json");
$post_data = @file_get_contents('php://input');
$priorities = $oauth->getClient('oauth_token',
'oauth_secet')
->post($endpoint,$headers_array,$post_data)
->send()->json();
Please suggest how to build a request to use jira attachment api
I am trying something like this for attachment
$headers_array = array("X-Atlassian-Token" => "nocheck",
"Content-Type" => "multipart/form-data"
);
$cfile = curl_file_create("test.txt");
$data = json_encode(array('file' => $cfile));
$priorities = $oauth->getClient('oauth_token',
'oauth_secet')
->post("rest/api/2/issue/GC-2200/attachments",$headers_array,$data);
but this is not working and throwing error.Please suggest.
Thanks