This class provides methods for manipulating the HTTP protocol (described in RFC 1945). More...
#include <Http.hpp>
Classes | |
class | Request |
This class wraps an HTTP request, which is basically :
| |
class | Response |
This class wraps an HTTP response, which is basically :
| |
Public Member Functions | |
Http () | |
Default constructor. | |
Http (const std::string &host, unsigned short port=0) | |
Construct the Http instance with the target host. | |
void | SetHost (const std::string &host, unsigned short port=0) |
Set the target host. | |
Response | SendRequest (const Request &request, float timeout=0.f) |
Send a HTTP request and return the server's response. |
This class provides methods for manipulating the HTTP protocol (described in RFC 1945).
It can connect to a website, get its files, send requests, etc.
Definition at line 45 of file Http.hpp.
sf::Http::Http | ( | const std::string & | host, | |
unsigned short | port = 0 | |||
) |
Http::Response sf::Http::SendRequest | ( | const Request & | request, | |
float | timeout = 0.f | |||
) |
Send a HTTP request and return the server's response.
You must be connected to a host before sending requests. Any missing mandatory header field will be added with an appropriate value. Warning : this function waits for the server's response and may not return instantly; use a thread if you don't want to block your application.
request | : Request to send | |
timeout | : Maximum time to wait, in seconds (0 by default, means no timeout) |
You must be connected to a host before sending requests. Any missing mandatory header field will be added with an appropriate value. Warning : this function waits for the server's response and may not return instantly; use a thread if you don't want to block your application.
void sf::Http::SetHost | ( | const std::string & | host, | |
unsigned short | port = 0 | |||
) |