overloaded BuildReponse in http_parser
This commit is contained in:
parent
ee12bb4e9c
commit
d0f2f78517
2 changed files with 12 additions and 0 deletions
|
@ -92,6 +92,17 @@ std::string & HTTP::Parser::BuildResponse(std::string code, std::string message)
|
|||
return builder;
|
||||
}
|
||||
|
||||
/// Returns a string containing a valid HTTP 1.0 or 1.1 response, ready for sending.
|
||||
/// The response is partly build from internal variables set before this call is made.
|
||||
/// To be precise, protocol, headers and body are used.
|
||||
/// \param code The HTTP response code. Usually you want 200.
|
||||
/// \param message The HTTP response message. Usually you want "OK".
|
||||
/// \return A string containing a valid HTTP 1.0 or 1.1 response, ready for sending.
|
||||
/// This function calls this->BuildResponse(this->method,this->url)
|
||||
std::string & HTTP::Parser::BuildResponse() {
|
||||
return BuildResponse(method,url);
|
||||
}
|
||||
|
||||
/// Creates and sends a valid HTTP 1.0 or 1.1 response.
|
||||
/// The response is partly build from internal variables set before this call is made.
|
||||
/// To be precise, protocol, headers and body are used.
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace HTTP {
|
|||
void SetBody(std::string s);
|
||||
void SetBody(char * buffer, int len);
|
||||
std::string & BuildRequest();
|
||||
std::string & BuildResponse();
|
||||
std::string & BuildResponse(std::string code, std::string message);
|
||||
void SendRequest(Socket::Connection & conn);
|
||||
void SendResponse(std::string code, std::string message, Socket::Connection & conn);
|
||||
|
|
Loading…
Add table
Reference in a new issue