Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×Hi
I am trying to create a pull request on my Bitbucket Server through terminal using the following command -
curl -v https://bitbucketserver.com/pull-requests \
-u username:Password \
--request POST \
--header 'Content-Type: application/json' \
--data “{\“title\”: \”Testing merge release into master\”, \”description\”: \”Description for Testing merge release into master\”, \”state\”: \”OPEN\”, \”open\”: true, \”closed\”: false, \”fromRef\”: { \”id\”: \”origin/release/7.4.1\”, \”repository\”: { \”slug\”: \”ios-app\”, \”name\”: null, \”project\”: { \”key\”: \”ABC\” } } }, \”toRef\”: { \”id\”: \”refs/heads/master\”, \”repository\”: { \”slug\”: \”ios-app\”, \”name\”: null, \”project\”: { \”key\”: \”ABC\” } } }, \”locked\”: false, \”reviewers\”: [ { \”user\”: { \”name\”: \”name\” } } ] }”
Not sure where it goes wrong - getting the following error -
* Connection #0 to host devops.vitality.co.uk left intact
{"errors":[{"context":null,"message":"Unexpected character ('â' (code 226)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: com.atlassian.stash.internal.web.util.web.CountingServletInputStream@2efad00; line: 1, column: 2]","exceptionName":"org.codehaus.jackson.JsonParseException"}]}Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: ”Testing
* Closing connection
curl: (6) Could not resolve host: ”Testing
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: merge
* Closing connection
curl: (6) Could not resolve host: merge
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: release
* Closing connection
curl: (6) Could not resolve host: release
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: into
* Closing connection
curl: (6) Could not resolve host: into
Note: Unnecessary use of -X or --request, POST is already inferred.
* URL rejected: Bad hostname
* Closing connection
curl: (3) URL rejected: Bad hostname
Note: Unnecessary use of -X or --request, POST is already inferred.
* URL rejected: Port number was not a decimal number between 0 and 65535
* Closing connection
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: ”Description
* Closing connection
curl: (6) Could not resolve host: ”Description
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: for
* Closing connection
curl: (6) Could not resolve host: for
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: Testing
* Closing connection
curl: (6) Could not resolve host: Testing
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: merge
* Closing connection
curl: (6) Could not resolve host: merge
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: release
* Closing connection
curl: (6) Could not resolve host: release
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: into
* Closing connection
curl: (6) Could not resolve host: into
Note: Unnecessary use of -X or --request, POST is already inferred.
* URL rejected: Bad hostname
* Closing connection
curl: (3) URL rejected: Bad hostname
Note: Unnecessary use of -X or --request, POST is already inferred.
* URL rejected: Port number was not a decimal number between 0 and 65535
* Closing connection
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
Note: Unnecessary use of -X or --request, POST is already inferred.
* URL rejected: Bad hostname
* Closing connection
curl: (3) URL rejected: Bad hostname
Note: Unnecessary use of -X or --request, POST is already inferred.
* URL rejected: Port number was not a decimal number between 0 and 65535
* Closing connection
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
Note: Unnecessary use of -X or --request, POST is already inferred.
* URL rejected: Bad hostname
* Closing connection
curl: (3) URL rejected: Bad hostname
Note: Unnecessary use of -X or --request, POST is already inferred.
* URL rejected: Port number was not a decimal number between 0 and 65535
* Closing connection
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
Note: Unnecessary use of -X or --request, POST is already inferred.
* URL rejected: Bad hostname
* Closing connection
curl: (3) URL rejected: Bad hostname
Note: Unnecessary use of -X or --request, POST is already inferred.
* URL rejected: Port number was not a decimal number between 0 and 65535
* Closing connection
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
curl: (3) unmatched brace in URL position 1:
The underlying exception type "org.codehaus.jackson.JsonParseException" suggests that the problem is in the request body JSON. It cannot be parsed, and it says that there is an invalid character in it.
How to fix?
Just validate the JSON with an online validator, it should help discover the problem. It should be something dead simple.
Hi @Priyanka Jaiswal ,
welcome to the Atlassian community.
I'm not sure, but I've got one idea. I can see these quotes ” in your request, but you should use these ". It's a different character.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.