Correct way to set Bearer token with CURL

前端 未结 7 882
悲哀的现实
悲哀的现实 2020-11-30 22:12

I get my bearer token from an API end point and set the following:

$authorization = \"Bearer 080042cad6356ad5dc0a720c18b53b8e53d4c274\"

Nex

7条回答
  •  感动是毒
    2020-11-30 22:59

    As at PHP 7.3:

    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BEARER);
    curl_setopt($ch,CURLOPT_XOAUTH2_BEARER,$bearerToken);
    

提交回复
热议问题