-
Bug
-
Resolution: Fixed
-
Low
-
8.0.0
-
1
-
Severity 3 - Minor
-
Issue Summary
We noted some inconsistency between the guide (https://developer.atlassian.com/server/bitbucket/rest/v810/api-group-system-maintenance/#api-api-latest-hook-scripts-scriptid-content-get) and command when run with the header Accept: application/json.
Steps to Reproduce
Follow the sample curl command given on the API document to get the content of the hook script as below:
curl --request GET \ --url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}/content' \ --header 'Accept: application/json'
Expected Results
The command as per the API document should return the content of the hook script.
Actual Results
Testing out the command based on the API document and failed to get a response:
pwaje@YDL91NPC6R ~ % curl -k -u admin:password --request GET \ --url 'https://dune/rest/api/latest/hook-scripts/2/content' \ --header 'Accept: application/json' pwaje@YDL91NPC6R ~ %
However, it does work when I don't use the header Accept: application/json or use the header Content-Type: application/json
pwaje@YDL91NPC6R ~ % curl -k -u admin:password --request GET \ --url 'https://dune/rest/api/latest/hook-scripts/2/content' echo "You didn't say the magic word" exit 1 pwaje@YDL91NPC6R ~ %
Workaround
Run the command without the header Accept: application/json or use the header Content-Type: application/json