Q:

Easy way to see the requests QGIS makes to a remote server?

I'm attempting to debug an issue with a remote ArcGis Server's WMTS as seen from GeoServer. I can see the requests GeoTools is making (because they throw an error and get logged). However the service works in QGIS (3.0 if that makes a difference) and I would like to know what the difference in the requests is.
I know I can set up wireshark or some such but I hoped there was a way of getting QGIS to log the URLs being requested directly via a flag or setting?.

A:

It seems there is no easy way to do this in QGis, so I solved it by adding a simple proxy, Python Logging Proxy which "does what it says on the can". 
I modified the file LoggingProxyHTTPHandler.py to comment out line 105 
print response.content

since I didn't need to see the "contents" of the images being sent back. Then to run the proxy all you do is
python ./proxy.py

And in QGis go to Settigns->Options->Network and turn on the use proxy for web access and fill in localhost and 8000 for the Host and Port. 

Then every time QGis requests a WMTS (or other web image) you will see the request and the response in the terminal.

A:

For QGIS 3.6 and up
For QGIS 3.6 and more recent versions, there is a useful plugin called 
QGIS Network Logger, developed by Richard Duivenvoorde.
It is much easier to check the requests sent out by QGIS (sent via the QgsNetworkAccessManager).

