forked from awwit/httpserverapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResponse.h
More file actions
25 lines (20 loc) · 737 Bytes
/
Response.h
File metadata and controls
25 lines (20 loc) · 737 Bytes
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
#pragma once
#include "protocol/ClientProtocol.h"
#include "../transfer/ProtocolVariant.h"
#include "../transfer/HttpStatusCode.h"
#include <unordered_map>
#include <string>
namespace HttpClient
{
struct Response
{
ClientProtocol *prot;
Transfer::ProtocolVariant protocol_variant;
std::unordered_map<std::string, std::string> headers;
Http::StatusCode status;
public:
void setStatusCode(const Http::StatusCode status);
bool sendHeaders(const std::vector<std::pair<std::string, std::string> > &additional, const std::chrono::milliseconds &timeout, const bool endStream = true);
long sendData(const void *src, const size_t size, const std::chrono::milliseconds &timeout, const bool endStream = true) const;
};
};