Hi All,
I am trying to create a tag for a hash in my bitbucket repository, but getting below response ,
{“type”: “error”, “error”: {“fields”: {“target”: “expected a dictionary”}, “message”: “Bad request”}}
Below is the end point and code,
url= https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commits/
response=requests.post(url,data={‘name’: ‘tag_17112020_v1’, ‘target’: {‘hash’: hash_for_commit}},auth=auth_tuple)
Also I have tried below with headers as well,
response=requests.post(url,headers={‘Content-Type’: ‘application/json’},data={‘name’: ‘tag_17112020_v1’, ‘target’: {‘hash’: hash_for_commit}},auth=auth_tuple)
But the response is ‘Bad request’.
Could you please help me on this. Thanks in advance