[Interest] Code using QNetworkAccessManager::post() working on Linux but not on Mac

Thiago Macieira thiago.macieira at intel.com
Fri Aug 25 17:47:25 CEST 2017


On Friday, 25 August 2017 06:05:15 PDT René J.V. Bertin wrote:
> I'm porting a Qt5-based little downloader from MS Windows to Mac+Linux (both
> have Qt 5.8.0). It uses a POST operation to authenticate with the server,
> using code that works fine on MSWin and Linux. On Mac, I keep getting a
> Forbidden reply from the server (the MSWin executable functions fine under
> Wine, though...)

Was there a request to the server in the first place? Or did QNAM fail without 
sending a request?

Was the request HTTP or was it HTTPS? If it was HTTP, can you check if there's 
anything different in the HTTP headers sent? Can you check why your HTTP 
server decided to send 403 Forbidden?

Other recommendations:

Remove your code that uses QNetworkConfigurationManager. You should always 
assume you're already connected.

Replace your QString-based URL construction with QUrlQuery.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list