asp.net - Can I make a WebRequest without setting ContentLength -


this goofy question i'm testing tool , need create unusual situation. want make post request sends several megabytes of data web server don't want content-length set. (it ok if set 0 or -1.)

httpwebrequest automatically sets request.contentlength length of requeststream buffer. there way prevent or circumvent this?

you can send post request without setting content-length header using chunked encoding. chunked encoding, send data in segments (or "chunks") instead of in single piece. useful when need send data server don't know size.

chunked encoding part of http 1.1 defined rfc 2616

.net provides sendchunked feature support scenario


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -