I am trying to delete the Pull request from repo where as i am getting 405 error.
curl -vvv -s -H "Authorization: Bearer $API-TOKEN" -X DELETE "https://code.server.com/stash/rest/api/1.0/projects/~skumar/repos/test/pull-requests?$PRID" --header "Content-Type: application/json" -H "Accept: application/json" --data '{ "version": "'"$PRVERSION"'" }' getting error 405, (The request HTTP method is not appropriate for the targeted resource) < allow: HEAD,POST,GET,OPTIONS.
I gave the values instead of variables. still got the same error.
Environment: Server version 6.6.4.
as per the api-document document, I can delete, where as i am getting 405 error. allowed methods are HEAD,POST,GET,OPTIONS. I am the owner of the repo and have admin privileges.
Community moderators have prevented the ability to post new answers.
Hi Sai,
The pull request ID needs to be provided as part of the path, not as a query string - try something like this instead:
curl -vvv -s -H "Authorization: Bearer $API-TOKEN" -X DELETE "https://code.server.com/stash/rest/api/1.0/projects/~skumar/repos/test/pull-requests/$PRID" --header "Content-Type: application/json" -H "Accept: application/json" --data '{ "version": "'"$PRVERSION"'" }'
Cheers,
Christian
Premier Support Engineer
Atlassian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.