sf::Http::Http::Response Class Reference
This class wraps an HTTP response, which is basically :- a header with a status code and a set of field/value pairs
- a body (the content of the requested resource).
#include <Http.hpp>
Public Types | |
enum | Status { Ok = 200, Created = 201, Accepted = 202, NoContent = 204, MultipleChoices = 300, MovedPermanently = 301, MovedTemporarily = 302, NotModified = 304, BadRequest = 400, Unauthorized = 401, Forbidden = 403, NotFound = 404, InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceNotAvailable = 503, InvalidResponse = 1000, ConnectionFailed = 1001 } |
Enumerate all the valid status codes returned in a HTTP response. More... | |
Public Member Functions | |
Response () | |
Default constructor. | |
const std::string & | GetField (const std::string &Field) const |
Get the value of a field. | |
Status | GetStatus () const |
Get the header's status code. | |
unsigned int | GetMajorHttpVersion () const |
Get the major HTTP version number of the response. | |
unsigned int | GetMinorHttpVersion () const |
Get the major HTTP version number of the response. | |
const std::string & | GetBody () const |
Get the body of the response. | |
Friends | |
class | Http |
Detailed Description
This class wraps an HTTP response, which is basically :- a header with a status code and a set of field/value pairs
- a body (the content of the requested resource).
Definition at line 168 of file Http.hpp.
Member Enumeration Documentation
Enumerate all the valid status codes returned in a HTTP response.
- Enumerator:
-
Ok Most common code returned when operation was successful. Created The resource has successfully been created. Accepted The request has been accepted, but will be processed later by the server. NoContent Sent when the server didn't send any data in return. MultipleChoices The requested page can be accessed from several locations. MovedPermanently The requested page has permanently moved to a new location. MovedTemporarily The requested page has temporarily moved to a new location. NotModified For conditionnal requests, means the requested page hasn't changed and doesn't need to be refreshed. BadRequest The server couldn't understand the request (syntax error). Unauthorized The requested page needs an authentification to be accessed. Forbidden The requested page cannot be accessed at all, even with authentification. NotFound The requested page doesn't exist. InternalServerError The server encountered an unexpected error. NotImplemented The server doesn't implement a requested feature. BadGateway The gateway server has received an error from the source server. ServiceNotAvailable The server is temporarily unavailable (overloaded, in maintenance, ...). InvalidResponse Response is not a valid HTTP one. ConnectionFailed Connection with server failed.
Constructor & Destructor Documentation
sf::Http::Http::Response::Response | ( | ) |
Member Function Documentation
const std::string & sf::Http::Http::Response::GetBody | ( | ) | const |
Get the body of the response.
The body can contain :
- the requested page (for GET requests)
- a response from the server (for POST requests)
- nothing (for HEAD requests)
- an error message (in case of an error)
- Returns:
- The response body
- the requested page (for GET requests)
- a response from the server (for POST requests)
- nothing (for HEAD requests)
- an error message (in case of an error)
const std::string & sf::Http::Http::Response::GetField | ( | const std::string & | Field | ) | const |
unsigned int sf::Http::Http::Response::GetMajorHttpVersion | ( | ) | const |
unsigned int sf::Http::Http::Response::GetMinorHttpVersion | ( | ) | const |
Http::Response::Status sf::Http::Http::Response::GetStatus | ( | ) | const |
The documentation for this class was generated from the following files:
:: Copyright © 2007-2008 Laurent Gomila, all rights reserved :: Documentation generated by doxygen 1.5.2 ::