我正在尝试使用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);
当我将 URL 粘贴到浏览器中时,服务器响应正确。我了解到这是由服务器拒绝客户端的 HTTP 版本引起的,但我不知道为什么会发生这种情况。
任何帮助深表感谢。提前致谢