I’m trying to use the get() method of the QNetworkRequest class to retrieve a small XML file from my company’s web site. The file can be viewed with a browser with no problems. The Qt application gets a Qt UnknownContentError returned.
The browser’s HTTP GET request looks like this:
GET /asn1ve/version.xml HTTP/1.1
Host: www.obj-sys.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: __utma=128261458.1963682936.1358861953.1376483518.1376508822.171; __utmz=128261458.1358861953.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); PHPSESSID=9e5c245a6b212c1831d5b830e340e242; __utmb=128261458.2.10.1376508822; __utmc=128261458
Connection: keep-alive
The HTTP GET request that’s sent by my Qt application looks like this:
GET /asn1ve/version.xml HTTP/1.1
Host: www.obj-sys.com
User-Agent: Mozilla/5.0
Accept: application/xml
Accept-Language: en-US,*
Accept-Encoding: gzip, deflate
Connection: keep-alive
The server’s response to the Qt request is an HTTP 406 “Not Acceptable” error. The long text is “An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.”
I realize that the Qt HTTP GET isn’t exactly the same as the browser HTTP GET, but I don’t see any differences that would cause this error. The response to the browser request brings the file in with application/xml as the content type.
Any ideas?
↧