Put API call Returning an HTTP error of 400

Issue #13012 closed
Nathan Lang
created an issue

I am using python's requests and it works for every other API call that I have tried to call but it is not working for the API version 1 put call. Here is a copy of my code:

def postDescription(desc):
    un = "username" #not actual user name
    pw = "Password" # not actual password
    url = "https://api.bitbucket.org/1.0/repositories/{account}/test_repo_1"
    try:
        response = requests.put(url, data={"description": desc}, auth=(un, pw))
        response.raise_for_status()
        print(str(response.json()))
        print('Description added')
    except requests.HTTPError as e:
        print('ERROR: Description Update Code: ' + str(e.response) + '\n')


desc = 'Test Description'
postDescription(desc)

I have tried replacing the put with a get call and it works fine. I've looked over the API documentation and cant find where I am going wrong.

Comments (4)

  1. Marcus Bertrand staff
    • edited description
    • changed status to closed

    As there's been no activity on this issue for some time, we're closing this issue. If you continue to have issues using Bitbucket Cloud, please raise a new issue here for Bug/Features and support.atlassian.com for Support.

    Cheers,
    Marcus

  2. Log in to comment