Switched to using a JSON POST request. Also improved robustness of querying code by adding an appropriate 'Accept' header to the request and an error to handle problems with HTTP 406 Not Acceptable.