5

Using Wireshark, Send POST data with HttpWebRequest, the data is being sent in a secondary packet instead of being applied to the primary packet and then sending secondary packets if need be.

HttpWebRequest is sending only header information in the first packet and then POST data in the second packet. This is causing the HTTP Server to respond before the full HTTP request is received. Server is acting like an empty POST message even with the Content-Length being set in the header because no content has been append to the initial HTTP request packet.

This issue is only replicable using .Net HttpWebRequest. Using python, curl, or every other form of HTTP Client request does not cause this issue.

Currently using .Net framework 4.5.

Any way to force .Net HttpWebRequest to send POST data in the initial request packet?

P.S. I am not talking about the TCP SYN and ACK packets that come before Application content.

Mike
  • 59
  • 1
  • 1
    You are aware that the server is broken, right? And it can't be fixed? – usr Jun 22 '15 at 23:37
  • Agree ^. What server is doing this? – glenebob Jun 22 '15 at 23:47
  • You don't think it might be a good idea to mention the fact that the server is fundamentally broken and that you're trying to find a workaround for it in the question? – glenebob Jun 23 '15 at 00:49
  • Did in the second paragraph. I know the workaround, is there away to make it work in .Net without having to marshal in a 3rd party solution like libcurl. And the content being sent can easily fit in a single packet exit whom ever implemented HttpWebRequest decided two is always needed. – Mike Jun 23 '15 at 13:30
  • 2
    @Mike - did you ever find a solution to this? I am having the same issue with the header data and post data being sent in two separate packets. – Calvin Pietersen Apr 10 '18 at 06:01
  • @CalvinPietersen did you ever found a solution? – Christian Gollhardt Jul 24 '23 at 15:34

0 Answers0