#include <Http.hpp>
Public Types | |
| enum | Method { Get, Post, Head } |
| Enumerate the available HTTP methods for a request. More... | |
Public Member Functions | |
| Request (Method RequestMethod=Get, const std::string &URI="/", const std::string &Body="") | |
| Default constructor. | |
| void | SetField (const std::string &Field, const std::string &Value) |
| Set the value of a field; the field is added if it doesn't exist. | |
| void | SetMethod (Method RequestMethod) |
| Set the request method. | |
| void | SetURI (const std::string &URI) |
| Set the target URI of the request. | |
| void | SetHttpVersion (unsigned int Major, unsigned int Minor) |
| Set the HTTP version of the request. | |
| void | SetBody (const std::string &Body) |
| Set the body of the request. | |
Friends | |
| class | Http |
Definition at line 54 of file Http.hpp.
| sf::Http::Request::Request | ( | Method | RequestMethod = Get, |
|
| const std::string & | URI = "/", |
|||
| const std::string & | Body = "" | |||
| ) |
Default constructor.
| RequestMethod | : Method to use for the request (Get by default) | |
| URI | : Target URI ("/" by default -- index page) | |
| Body | : Content of the request's body (empty by default) |
| void sf::Http::Request::SetField | ( | const std::string & | Field, | |
| const std::string & | Value | |||
| ) |
Set the value of a field; the field is added if it doesn't exist.
| Field | : Name of the field to set (case-insensitive) | |
| Value | : Value of the field |
| void sf::Http::Request::SetMethod | ( | Method | RequestMethod | ) |
Set the request method.
This parameter is Http::Request::Get by default
| RequestMethod | : Method to use for the request |
| void sf::Http::Request::SetURI | ( | const std::string & | URI | ) |
Set the target URI of the request.
This parameter is "/" by default
| URI | : URI to request, local to the host |
| void sf::Http::Request::SetHttpVersion | ( | unsigned int | Major, | |
| unsigned int | Minor | |||
| ) |
Set the HTTP version of the request.
This parameter is 1.0 by default
| Major | : Major version number | |
| Minor | : Minor version number |
| void sf::Http::Request::SetBody | ( | const std::string & | Body | ) |
Set the body of the request.
This parameter is optional and makes sense only for POST requests. This parameter is empty by default
| Body | : Content of the request body |