Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Request example 1:
- POST /v1/token HTTP/1.1
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
- grant_type=client_credentials&client_id=test&client_secret=abc123
- $url = "someUrl";
- $ch = curl_init();
- $username = "someUser";
- $password = "somePass";
- $post = json_encode(array(('grant_type'=>'client_credentials'));
- curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
- curl_setopt($ch,CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- $result = curl_exec($ch);
- curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement