HTTP request
Solved
General and Desktop
-
Hello, I try to create HTTP request in Qt, this is my include section:
#include "QHash" #include "QFile" #include "QCryptographicHash" #include "QtNetwork/QNetworkRequest" #include "QtNetwork/QNetworkAccessManager" #include "QUrl" #include "QUrlQuery" #include "QDebug"
This is code:
QUrl url("https://api.parse.com/1/login"); QUrlQuery query; query.addQueryItem("username", "test"); query.addQueryItem("password", "test"); url.setQuery(query.query()); QNetworkRequest request(url); request.setRawHeader("X-Parse-Application-Id", "myappid"); request.setRawHeader("X-Parse-REST-API-Key", "myapikey"); QNetworkAccessManager *manager = new QNetworkAccessManager(this); manager->get(request);
and there are errors:
What is wrong with it, please?
-
@t0msk said in HTTP request:
@aha_1980 Thank you, I forgot :) When I need to add that libraries into .pro file?
It is easy to forget libraries to add qmake. Most of us forget. However, it isa good advice to check the libraries setting when you get undefined references for Qt libs.
Please mark your thread as "solved"