HTTP Data chunks over multiple packets?
- by myforwik
What is the correct way for a HTTP server to send data over multiple packets?
For example I want to transfer a file, the first packet I send is:
HTTP/1.1 200 OK
Content-type: application/force-download
Content-Type: application/download
Content-Type: application/octet-stream
Content-Description: File Transfer
Content-disposition: attachment; filename=test.dat
Content-Transfer-Encoding: chunked
400
<first 1024 bytes here>
400
<next 1024 bytes here>
400
<next 1024 bytes here>
Now I need to make a new packet, if I just send:
400
<next 1024 bytes here>
All the clients close there connections on me and the files are cut short.
What headers do I put in a second packet to continue on with the data stream?