I'm currently trying to understand precisely what happens when a browser downloads a file to desktop, specifically how many HTTP requests are used, how the process is different to just getting a resource like an image or script, etc. I'd be grateful if anyone laid out a process here starting from A browser sends HTTP request
.
I'm currently trying to understand precisely what happens when a browser downloads a file to desktop, specifically how many HTTP requests are used, how the process is different to just getting a resource like an image or script, etc. I'd be grateful if anyone laid out a process here starting from A browser sends HTTP request
.
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="picture.png"
I know it's a bit of reading, but this is a good resource. Also, for a less intense introduction this helped me out quite a bit.
As to the number of HTTP requests used the answer is one. There is a TCP handshake done then the request is transmitted, after that the response is sent back. There is a little more involved if everything is over SSL/TLS, but that's all part of one HTTP request/response cycle.