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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Need to Edit and commit a file using the REST API

I am working on a project in python, where we need to either edit an existing file in bitbucket or add a new file, and then create a pull request.  i have been looking at the documentation which uses curl, and not the requests library, which is the preferred python method from my understanding.  

when i try to add a file, i keep getting an unsupported type (415) error.  i have set the content-type to application/json, but i'm unclear how to translate the file into the request.  here is my code:


headers = { "Content-type"'application/json'           


            'message''testing insertion',


myUrl = projectURL + '/browse/'

r = requests.put(myUrlheaders=headersdata=open('''r'), verify=Falseauth = HTTPBasicAuth(username,password))

i have not been able to find any example that shows what i'm trying to do.  

is there any documentation on this that anyone might know of?  




0 answers

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events