You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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',
'branch': 'test/new_branch',
'message': 'testing insertion',
'sourceCommitId': None}
myUrl = projectURL + '/browse/main2.tf'
r = requests.put(myUrl, headers=headers, data=open('main2.tf', 'r'), verify=False, auth = 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?
thanks,
-timothy