I tried in cURL its working But When I use it in same JSON format in python its showing 400.
curl --request POST -u usename:AppPassword \
--url 'https://api.bitbucket.org/2.0/repositories/*****/******/branch-restrictions' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"kind": "restrict_merges",
"branch_match_kind": "glob",
"pattern":"develop",
"groups": [
{
"slug": "administrators",
"full_slug": "****:administrators",
"name": "Administrators",
"default_permission": "admin",
"account_privilege": "admin"
}]
}'
its worked.
_________________________________________________________
But python
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.bitbucket.org/2.0/repositories/******/*******/branch-restrictions
Please help to solve this issue.
Thanks & Regards,
Karthikraj M