Another way to track HTTP requests and responses if you don't want to (or for some reason can't) sniff raw TCP/IP traffic is to run a local instance of
HTTP::Proxy and point both your browser and your script through that. Then take that proxy log and compare the results.