-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhttpMessage.hpp
More file actions
48 lines (40 loc) · 929 Bytes
/
Copy pathhttpMessage.hpp
File metadata and controls
48 lines (40 loc) · 929 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* @file
* @brief Header file containing HTTP message related structures and functions
*/
#pragma once
#include "httpHeader.hpp"
namespace http
{
struct RequestMessage ;
struct ResponseMessage ;
}
/// Struct representing a whole HTTP request message
struct http::RequestMessage
{
RequestHeader header ;
String payload ;
bool parsingFailed = false ;
operator String() const
{
return ( String ) header + payload + "\n" ;
}
} ;
/// Struct representing a whole HTTP response message
struct http::ResponseMessage
{
ResponseMessage(
const ResponseHeader & header_ ,
const String & payload_ = "" ,
const bool & parsingFailed_ = false
) :
header( header_ ), payload( payload_ ), parsingFailed( parsingFailed_ )
{} ;
ResponseHeader header ;
String payload ;
bool parsingFailed ;
operator String() const
{
return ( String ) header + payload + "\n" ;
}
} ;