How to prevent packet fragmentation for a HttpWebRequest

前端 未结 4 797
Happy的楠姐
Happy的楠姐 2021-01-12 05:02

I am having a problem using HttpWebRequest against a HTTP daemon on an embedded device. The problem appears to be that there is enough of a delay between the http headers be

4条回答
  •  别那么骄傲
    2021-01-12 05:40

    Is your embedded server a HTTP/1.1 server? If so, try setting Expect100Continue=false on the webrequest before you call GetRequestStream(). This will ensure that the HTTP stack does not expect the "HTTP/1.1 100 continue" header response from the server, before sending the entity body. So, even though the packets will still be split between the header and body, the inter packet gap will be shorter.

提交回复
热议问题