Hi,
I'm trying to use the following API in order to update an existing feature branch's file.
I'm using Postman with the following request URL: https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/src?branch=<my-branch> with content-type as "application/x-www-form-urlencoded" as a header and with body as "x-www-form-urlencoded" with the following key-value for the desired file which I want to modify:
key: "/README.md"
value: "new-value"
when initiating the request I'm getting back 201 created status but the file that was modified is the readme file located on my "main" branch and not on my feature branch.
what am I missing here?
Hello @Nimrod Golan and thank you for reaching out to Community!
The Create a commit by uploading a file endpoint expects the branch name to come as one of the key/value pair when using application/x-www-form-urlencoded. You can try to specify the key as branch and the value as the branch name :
This should make the commit to be created on the top of the branch provided.
Could you try that suggestion and let us know how it goes?
Thank you, @Nimrod Golan !
Patrik S
That worked, thanks! maybe it's better refine it on the endpoint documentation.
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.