-1

I input the URL in the address bar in the browser of the virtual machine, and the URL requests an HTML document in my host computer (this HTML document is also written by me). Then the HTML document is successfully displayed in the virtual machine browser. It seems that the HTTP request and response are successfully sent, otherwise the HTML document cannot be seen in the browser. I tracked this process with Wireshark software and found the HTTP request (that is, the request for HTML document) sent by the virtual machine to my host computer, as shown in the following screenshot:(some personal information is masked with purple)

HTTP request

Double clicked this request to see the details and I found that:

request's detail

It showed the response is in frame 6. However, the contents of the HTML document cannot be found after opening the details of the frame 6. I wrote the HTML myself. I know there are stuffs like "button", "input". Normally, the content of these HTML should be in the HTTP response, but I couldn't find it, not even a "body". There is no HTML document content in the HTTP response. The whole frame 6 is down below:

response's detail

1 Answers1

1

You get a HTTP status code 304 Not Modified and not a status code 200 back. This means that the browser already had the response body and just verified with the server is the body is still the same as it has cached. You should see an If-None-Match field and/or If-Modified-Since

Since the body has not changed the server just informs the browser using status code 304 about this so that it uses the already cached response. It does not send the content again in the response body since it is not needed by the browser. If you want to get the actual content in the response make sure it is not already cached, i.e. remove all caches in the browser or use a client which does not cache, like curl.

Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172