astream_context_create中的承载授权

时间:2018-06-15 16:04:13

标签: php header authorization token

我试图将持有者access_token的请求发送到远程服务器。 access_token已由此服务器发送(看起来像52fhjk-24ca-4c73-1b91-12fced3b205b)

$header = "Content-Type: application/x-www-form-urlencoded\r\n Authorization: Bearer ".$access_token;
$options = array(
      'http' => array(
          'header'  => $header,
          'method'  => 'POST',
          'content' => http_build_query($postValues)
      )
  );
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

但是$结果是空的

0 个答案:

没有答案
相关问题