-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhttpresponse.hpp
46 lines (36 loc) · 1.08 KB
/
httpresponse.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef BIDSTACK_HTTP_RESPONSE_HPP
#define BIDSTACK_HTTP_RESPONSE_HPP
#include <QObject>
#include <QNetworkReply>
#include "httpbody.hpp"
namespace Bidstack {
namespace Http {
class HttpResponse : public QObject {
Q_OBJECT
public:
HttpResponse(int status, QObject *parent = 0);
HttpResponse(int status, QMap<QString, QString> headers, HttpBody *body, QObject *parent = 0);
HttpResponse(QNetworkReply *reply, QObject *parent = 0);
public:
int status();
QMap<QString, QString> headers();
HttpBody* body();
public:
bool isValid();
bool isInformational();
bool isSuccessful();
bool isRedirection();
bool isClientError();
bool isServerError();
bool isOk();
bool isForbidden();
bool isNotFound();
bool isEmpty();
private:
int m_status;
QMap<QString, QString> m_headers;
HttpBody* m_body;
};
};
};
#endif