Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Pass query parameters on file upload via API?

maxym June 11, 2020

Hi, i am using curl to upload file 

echo "${FILE}" | curl "${CLOUD_API_ADDRESS}/repositories/${ORG_NAME}/${REPO_NAME}/src/?branch=${FEATURE_BRANCH}" \ --user myname:mypassword \ -F /src/test.json=@-

 According to documentation there is an ability to pass query params, but still my file is uploading to main branch.  https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/src

 

If i am using  application/x-www-form-urlencoded everything is fine with query parameters, but i cant pass file in this way.

 

How can i upload file and specify query parameters? (branch, message etc.)

1 answer

1 accepted

1 vote
Answer accepted
maxym June 11, 2020

Finally i found a solution. You should pass "query" params as form values. For example, 

-F "branch=feature/branch"

Atlassian team, please update docs, it is not query params, it was very confused. 

Jordan Disch
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!
January 18, 2024

++++++1 for updating the docs please

Jordan Disch
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!
January 18, 2024

also thanks @maxym for going through that struggle 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events