-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHeaders.h
50 lines (34 loc) · 974 Bytes
/
Headers.h
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
#pragma once
#include <string>
#include <map>
#include <curl/curl.h>
namespace HTTP {
class Headers
{
public:
typedef std::map<std::string, std::string> HeaderMap;
typedef std::pair<std::string, std::string> StringPair;
typedef HeaderMap::const_iterator const_iterator;
enum Type {
REQUEST=0,
RESPONSE
};
Headers();
Headers(Type type);
~Headers();
bool isSet(const std::string & name);
std::string get(const std::string & name);
std::string operator [](const std::string & name);
void set(const std::string & name, const std::string & value);
void set(const std::string & name);
void clear();
unsigned int size();
const_iterator begin() const;
const_iterator end() const;
const struct curl_slist * getCurlHeaders() const;
private:
HeaderMap headers_;
Type type_;
struct curl_slist * curlHeaders_;
};
}