C#: Handling WebClient “protocol violation”

前端 未结 2 1800
旧时难觅i
旧时难觅i 2020-12-03 17:14

I need to read a location in my Router, but I get the following exception -

ServerProtocolViolation \"The server committed a protocol violation. 
                    


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-03 17:37

    I had this problem in my own webserver, in header I changed

    HTTP/1.x 200 OK
    

    to

    HTTP/1.0 200 OK
    

    now it works when I use a browser (chorome or ...) or in WebClient (c#)

提交回复
热议问题