-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHttpRequestGenerator
More file actions
48 lines (37 loc) · 1.05 KB
/
HttpRequestGenerator
File metadata and controls
48 lines (37 loc) · 1.05 KB
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
/*
* Copyright (C) 2021 Frank Mertens.
*
* Distribution and use is allowed under the terms of the GNU General Public License version 3
* (see CoreComponents/LICENSE-gpl-3.0).
*
*/
#pragma once
#include <cc/HttpMessageGenerator>
namespace cc {
/** \class HttpRequestGenerator cc/HttpRequestGenerator
* \ingroup http_protocol
* \brief HTTP request generator
*/
class HttpRequestGenerator final: public HttpMessageGenerator
{
public:
/** Create a new HTTP request generator for \a stream
*/
HttpRequestGenerator(const Stream &stream);
/** %Set the request method (either "GET", "HEAD", "PUT" or "POST")
*/
void setMethod(const String &method);
/** %Set the relative resource file path
*/
void setPath(const String &path);
/** %Set the protocol version (defaults to "HTTP/1.1")
*/
void setVersion(const String &version);
/** %Set the host header, equivalent to setHeader("Host", \a host)
*/
void setHost(const String &host);
private:
struct State;
State &me();
};
} // namespace cc