1 #ifndef _HTTP_RESPONSE_H_ 2 #define _HTTP_RESPONSE_H_ 62 this->protocol = protocol;
69 << response.
code <<
" " 77 if(getline(in, line)) {
78 if(line.size() <= 0) in.setstate(istream::failbit);
80 istringstream in_str(line);
82 if(!(in_str >> response.
protocol >> response.
code >> cad))
83 in.setstate(istream::failbit);
Class used to identify a HTTP response.
Definition: response.h:24
int code
Status code.
Definition: response.h:42
Class used for the initializer.
Definition: response.h:30
Protocol protocol
Protocol version.
Definition: response.h:43
static StatusCodesInitializer statusCodesInitializer
The initializer of the StatusCodes member.
Definition: response.h:39
static map< int, string > StatusCodes
Map with the strings associated to the most commonly used status codes.
Definition: response.h:51
Contains the definition of a set of classes for working easily with the protocol HTTP.
Definition: header.cc:4
Class used to identify the HTTP protocol.
Definition: protocol.h:20
Response(int code=200, const Protocol &protocol=Protocol(1, 1))
Initializes the response.
Definition: response.h:59
istream & operator>>(istream &in, Request &request)
Definition: request.cc:51
static const char CRLF[]
String with the characters 13 (CR) and 10 (LF), the line separator used in the HTTP protocol...
Definition: protocol.h:31
ostream & operator<<(ostream &out, const Request &request)
Definition: request.cc:65