Class for sending HTTP requests and handle the servers response.
More...
#include <RequestHandler.h>
|
| RequestHandler (const QString &username, const QString &password, QNetworkAccessManager *nam) |
|
| RequestHandler (QNetworkAccessManager *nam) |
|
QNetworkReply * | getRequest (const QString &url) |
| Sends a GET request with the given url and receives the servers response. More...
|
|
QNetworkReply * | authGetRequest (const QString &url) |
| Sends a GET request with the given url, adds auth Data to the URL and receives the servers response. More...
|
|
QNetworkReply * | postRequest (const QByteArray data, const QString &url) |
| Sends a POST request with the given url and data, adds auth Data and receives the servers response. More...
|
|
Class for sending HTTP requests and handle the servers response.
mygpo::RequestHandler::RequestHandler |
( |
const QString & |
username, |
|
|
const QString & |
password, |
|
|
QNetworkAccessManager * |
nam |
|
) |
| |
- Parameters
-
username | The username that should be used for authentication if required. |
password | The password that should be used for authentication if required |
QNetworkReply* mygpo::RequestHandler::authGetRequest |
( |
const QString & |
url | ) |
|
Sends a GET request with the given url, adds auth Data to the URL and receives the servers response.
- Parameters
-
response | The servers response will be written into this QByteArray |
url | The request url (without http://) as QString |
- Returns
- 0 if the request was successful, corresponding ErrorCode if unsuccessful
QNetworkReply* mygpo::RequestHandler::getRequest |
( |
const QString & |
url | ) |
|
Sends a GET request with the given url and receives the servers response.
- Parameters
-
response | The servers response will be written into this QByteArray |
url | The request url (without http://) as QString |
- Returns
- 0 if the request was successful, corresponding ErrorCode if unsuccessful
QNetworkReply* mygpo::RequestHandler::postRequest |
( |
const QByteArray |
data, |
|
|
const QString & |
url |
|
) |
| |
Sends a POST request with the given url and data, adds auth Data and receives the servers response.
- Parameters
-
data | The data to send to the url |
url | The request url (without http://) as QString |
- Returns
- 0 if the request was successful, corresponding ErrorCode if unsuccessful
The documentation for this class was generated from the following file:
- /home/t95012/src/libmygpo-qt/src/RequestHandler.h