为了账号安全,请及时绑定邮箱和手机立即绑定

使用 PHP file_get_contents 调用 ODATA 服务

使用 PHP file_get_contents 调用 ODATA 服务

PHP
守着一只汪 2021-10-15 17:07:18
我需要在 Debian 9 下使用 php7.0 调用 ODATA 服务。我正在尝试使用“file_get_contents”函数,但是当我运行脚本时$call_opts=array(    "http"=>array(        "method"=>"GET",        "header"=>"Content-type: application/x-www-form-urlencoded",    ));//$call_context=stream_context_create($call_opts);$call_res_json=file_get_contents($url,false);它返回以下内容:Warning: file_get_contents(http://<URL>): failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized我也有用户名和密码,但我不知道如何使用它们。
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 128 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信