Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bearer token as Header not working #6

Open
rokdd opened this issue Aug 17, 2021 · 0 comments
Open

Bearer token as Header not working #6

rokdd opened this issue Aug 17, 2021 · 0 comments

Comments

@rokdd
Copy link

rokdd commented Aug 17, 2021

I noticed that when the token_type is a bearer the script is not working:

function http($url, $params=false,$bearer=false) {
  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   if($bearer!=false)
{
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer ".$bearer ));
}
  if($params)
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
$r=curl_exec($ch);
//echo $r;
 return json_decode($r);
}

Shall I create a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant