<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.backand.co/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "grant_type=password&appName=todoswithuser1&accessToken=45f33798-22c4-46c2-aa35-bc28c854322a",
CURLOPT_HTTPHEADER => array(
"accept: Accept:application/json",
"cache-control: no-cache",
"content-type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Created
October 26, 2016 13:15
-
-
Save itayher/4c93ef4cf5b7040a5ef8b38749fa3aad to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment