Loading...
Searching...
No Matches
Http.hpp
Go to the documentation of this file.
7// In no event will the authors be held liable for any damages arising from the use of this software.
83 Request(const std::string& uri = "/", Method method = Method::Get, const std::string& body = "");
void setHttpVersion(unsigned int major, unsigned int minor)
Set the HTTP version for the request.
Request(const std::string &uri="/", Method method=Method::Get, const std::string &body="")
Default constructor.
void setField(const std::string &field, const std::string &value)
Set the value of a field.
@ ServiceNotAvailable
The server is temporarily unavailable (overloaded, in maintenance, ...)
Definition Http.hpp:227
@ MovedPermanently
The requested page has permanently moved to a new location.
Definition Http.hpp:212
@ Accepted
The request has been accepted, but will be processed later by the server.
Definition Http.hpp:205
@ ResetContent
The server informs the client that it should clear the view (form) that caused the request to be sent...
Definition Http.hpp:207
@ Forbidden
The requested page cannot be accessed at all, even with authentication.
Definition Http.hpp:219
@ PartialContent
The server has sent a part of the resource, as a response to a partial GET request.
Definition Http.hpp:208
@ RangeNotSatisfiable
The server can't satisfy the partial GET request (with a "Range" header field)
Definition Http.hpp:221
@ MovedTemporarily
The requested page has temporarily moved to a new location.
Definition Http.hpp:213
@ NotModified
For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed.
Definition Http.hpp:214
@ GatewayTimeout
The gateway server couldn't receive a response from the source server.
Definition Http.hpp:228
unsigned int getMajorHttpVersion() const
Get the major HTTP version number of the response.
const std::string & getField(const std::string &field) const
Get the value of a field.
unsigned int getMinorHttpVersion() const
Get the minor HTTP version number of the response.
Http(const std::string &host, unsigned short port=0)
Construct the HTTP client with the target host.
Response sendRequest(const Request &request, Time timeout=Time::Zero)
Send a HTTP request and return the server's response.
Definition AudioResource.hpp:36