I am working on automating a perl script by using rest api to create a restriction for supplied branch except for some user. Based on REST API for branch permissions, which is documented here.The document explained about the syntax of how to use GET but did not explain how the POST syntax are and how to use it .Here are some of the stuff that I have done before I got the road block.
I first obtain credential from bitbucket .Then construct json using the same format in document API and then perform encode_json in my script.The post command that I have constructed as below which is the final piece that I having problem with.
example 1: $client->POST("/rest/api/1.0/projects/COMMON/repos/data,$json, $headers);
example 2: $client->POST("/rest/branch-permissions/2.0/projects/COMMON/repos/data/restrictions/,$json, $headers);