Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to create a Pull request on Bitbucket Server from Terminal

Priyanka Jaiswal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 6, 2025

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:

 

2 answers

0 votes
Aron Gombas _Midori_
Community Champion
August 8, 2025

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.

0 votes
Hana Kučerová
Community Champion
August 6, 2025

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events