forked from fpoussin/qhttp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qhttpclientrequest.hpp
67 lines (54 loc) · 2.04 KB
/
qhttpclientrequest.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/** HTTP request from a client.
* https://github.com/azadkuh/qhttp
*
* @author amir zamani
* @version 2.0.0
* @date 2014-07-11
*/
#ifndef QHTTPCLIENT_REQUEST_HPP
#define QHTTPCLIENT_REQUEST_HPP
// configured by src.pro
#if defined(QHTTP_HAS_CLIENT)
///////////////////////////////////////////////////////////////////////////////
#include "qhttpabstracts.hpp"
#include <QUrl>
///////////////////////////////////////////////////////////////////////////////
namespace qhttp {
namespace client {
///////////////////////////////////////////////////////////////////////////////
/** a class for building a new HTTP request.
* the life cycle of this class and the memory management is handled by QHttpClient.
* @sa QHttpClient
*/
class QHTTP_API QHttpRequest : public QHttpAbstractOutput
{
Q_OBJECT
public:
virtual ~QHttpRequest();
public: // QHttpAbstractOutput methods:
/** @see QHttpAbstractOutput::setVersion(). */
void setVersion(const QString& versionString) override;
/** @see QHttpAbstractOutput::addHeader(). */
void addHeader(const QByteArray& field, const QByteArray& value) override;
/** @see QHttpAbstractOutput::headers(). */
THeaderHash& headers() override;
/** @see QHttpAbstractOutput::write(). */
void write(const QByteArray &data) override;
/** @see QHttpAbstractOutput::end(). */
void end(const QByteArray &data = QByteArray()) override;
public:
/** returns parent QHttpClient object. */
QHttpClient* connection() const;
protected:
explicit QHttpRequest(QHttpClient*);
explicit QHttpRequest(QHttpRequestPrivate&, QHttpClient*);
friend class QHttpClient;
Q_DECLARE_PRIVATE(QHttpRequest)
QScopedPointer<QHttpRequestPrivate> d_ptr;
};
///////////////////////////////////////////////////////////////////////////////
} // namespace client
} // namespace qhttp
///////////////////////////////////////////////////////////////////////////////
#endif // QHTTP_HAS_CLIENT
#endif // define QHTTPCLIENT_REQUEST_HPP