Solved Is there any difference between QNetworkAccessManager::sendCustomRequest(request, "GET", QByteArray()) and QNetworkAccessManager::get(request);
-
Hi,
today, I found
when I use QNetworkAccessManager::sendCustomRequest(request, "GET", QByteArray()) , I got 403
but when I use QNetworkAccessManager::get(request), I can got response.after analyzing HTTP request, I found
when I use QNetworkAccessManager::sendCustomRequest(request, "GET", QByteArray())
There will be an extra line:Content-Length: 0
Is there any difference between these two methods?
Or, the extra line will cause some server parse error or something else? -
As you can see there is a difference. I would guess the content-length:0 comes from the empty QByteArray() you pass to the sendCustomRequest() function.
Why the server behaves differently is out of our scope (and Qt's scope)