For several days I have been trying to establish communication with the server using HttpWebRequest. I noticed that server isn't compliant with the protocol specification of the http in RFC. Therefore, I set tru in App.config:
<httpWebRequest useUnsafeHeaderParsing = "true" />
After doing this, I received a 400 answer. I noticed that I can communicate using curl software. I set the same headings in my code - with no result.
Finally, I noticed that the order of the host header is a problem. If the host header is after POST / HTTP / 1.1, the server responds is OK, but if it is at the end of all headers, then I get the code 400.
Didn't work:
POST / HTTP / 1.1
User-Agent: curl / 7.52.1
Accept: * / *
Content-Type: text / xml; charset = ISO-8859-1
SOAPAction: ...
Host: 10.10.10.147
It works:
POST / HTTP / 1.1
Host: 10.10.10.147
User-Agent: curl / 7.52.1
Accept: * / *
Content-Type: text / xml; charset = ISO-8859-1
SOAPAction: ...
Is there any possibility to change the order of headers using HttpWebRequest?