相关疑难解决方法(0)

HTTP请求失败!HTTP/1.1 505 HTTP版本不支持错误

我正在尝试使用file_get_contents()来从服务器获取响应并遇到此错误.有人能告诉我是什么原因以及如何解决它?代码的一部分是:

$api = "http://smpp5.routesms.com:8080/bulksms/sendsms?username=$username&password=$password&source=$source&destination=$destin&dlr=$dlr&type=$type&message=$message";
$resp = file_get_contents($api);
Run Code Online (Sandbox Code Playgroud)

当我在浏览器中粘贴网址时,服务器响应正确.我了解到这是由服务器拒绝客户端的HTTP版本引起的,但我不知道为什么会发生这种情况.

任何帮助深表感谢.提前致谢

php curl http file-get-contents

14
推荐指数
2
解决办法
3万
查看次数

标签 统计

curl ×1

file-get-contents ×1

http ×1

php ×1