libfilezilla 0.59.0
A cross-platform C++ library for asynchronous and networked applications
Loading...
Searching...
No Matches
headers.hpp
Go to the documentation of this file.
1#ifndef LIBFILEZILLA_HTTP_HEADERS_HEADER
2#define LIBFILEZILLA_HTTP_HEADERS_HEADER
3
7
8#include <map>
9#include <optional>
10
11#include "../string.hpp"
12
13namespace fz {
14
15class uri;
16
17namespace http {
18
19enum class continuation
20{
21 next,
22 wait,
23 done,
24 error
25};
26
27typedef std::map<std::string, std::string, less_insensitive_ascii> headers;
28
29class FZ_PUBLIC_SYMBOL with_headers
30{
31public:
32 virtual ~with_headers();
33
34 std::optional<uint64_t> get_content_length() const;
35
37 void set_content_length(uint64_t l);
38
41
43 bool chunked_encoding() const;
44
45 void set_content_type(std::string content_type);
46
47 std::string get_header(std::string const& key) const;
48
49 bool keep_alive() const;
50
51 headers headers_;
52};
53
55std::string FZ_PUBLIC_SYMBOL get_canonical_host(uri const& uri);
56
57}
58}
59
60#endif
Definition headers.hpp:30
void set_chunked_encoding()
Sets Transfer-Encoding to chunked. Also clears Content-Length.
void set_content_length(uint64_t l)
Sets Content-Lenght. Also clears Transfer-Encoding.
bool chunked_encoding() const
Whether chunked encoding is used.
The uri class is used to decompose URIs into their individual components.
Definition uri.hpp:30
std::string get_canonical_host(uri const &uri)
Canonicalizes the URI for use in the Host: header.
The namespace used by libfilezilla.
Definition apply.hpp:17
String types and assorted functions.