We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
According to the documentation about uploading a file, it seems like there is something missing in both of upload_file and update_file methods. I assume that these should have a Content-Type: multipart/form-data header, shouldn't they?
upload_file
update_file
Content-Type: multipart/form-data
I keep seeing the error message below when I try running the following code:
from atlassian.bitbucket import Bitbucket b = Bitbucket("http://localhost:7990", token=TOKEN) b.update_file("COOL","blah1","abcbcbcbc", "ccccccc", "refs/heads/main", "file1.txt", "6147607593f94ede454db5deba7a3ac5549bef3c")
requests.exceptions.HTTPError: 415 Client Error: for url: http://localhost:7990/rest/api/1.0/projects/COOL/repos/blah1/browse/file1.txt
This is how a curl command works:
curl -X PUT -H "Authorization: Bearer $TOKEN" -F content=@/tmp/file.txt -F 'message=Updated using file-edit REST API' -F branch=main http://localhost:7990/rest/api/latest/projects/COOL/repos/blah1/browse/README.md
Appending -F sourceCommitId=5e18a05b8e87de4b01e3c07969f0168acacaafba will update the file in case it exists.
-F sourceCommitId=5e18a05b8e87de4b01e3c07969f0168acacaafba
Not sure if I'm right or just maybe doing something wrong?
The text was updated successfully, but these errors were encountered:
[Bitbucket] Fixed broken update_file and upload_file API calls (fixes…
858cbc0
… issue #1080) (#1092) * [Bitbucket] Fixed broken update_file and upload_file API calls * Black formatting Co-authored-by: Gonchik Tsymzhitov <gonchik.tsymzhitov@gmail.com>
Hi @Shaked, the above PR fixes this. It should go out in the next release. 😄
Sorry, something went wrong.
Hi @Shaked ! it has been released. Thank you for your work @jnbolito !
Cheers, Gonchik Tsymzhitov
No branches or pull requests
According to the documentation about uploading a file, it seems like there is something missing in both of
upload_file
andupdate_file
methods. I assume that these should have aContent-Type: multipart/form-data
header, shouldn't they?I keep seeing the error message below when I try running the following code:
This is how a curl command works:
Appending
-F sourceCommitId=5e18a05b8e87de4b01e3c07969f0168acacaafba
will update the file in case it exists.Not sure if I'm right or just maybe doing something wrong?
The text was updated successfully, but these errors were encountered: