HTTP request failed! HTTP/1.1 505 HTTP Version Not Supported error

前端 未结 6 2034
野趣味
野趣味 2020-12-07 01:27

I\'m trying to use file_get_contents() to get the response from a server and this error was encountered. Could someone tell me what is the reason and how to fix

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-07 01:54

    Can you sniff what's happening on the wire? Seeing the format of the HTTP request as it goes out on the wire would help a lot.

    Without seeing that, my best guess would be that the server isn't well-implemented, and is rejecting a HTTP/1.1 request. Try setting --http1.0 on Curl and seeing what happens...

提交回复
热议问题