The server committed a protocol violation. Section=ResponseStatusLine in c#

前端 未结 2 860
半阙折子戏
半阙折子戏 2021-01-24 04:35

I have spent a whole day trying to resolve this. I have a custom webserver and requests to it from Chrome or POSTman ReST client work fine. As soon a s I use webclient or httpw

2条回答
  •  忘掉有多难
    2021-01-24 05:32

    I struggled with that issue for a long time, and eventually the problem was a custom header that I added to IIS... I copied the value from somewhere and it contained {cr}:

    Open IIS Manager -> go to the web site -> on content view, choose "Response Headers".

    check the custom headers on IIS, remove headers if they are not needed, and also see if a header has a malformed value.

提交回复
热议问题