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 = "");
203 Ok = 200,
204 Created = 201,
205 Accepted = 202,
206 NoContent = 204,
207 ResetContent = 205,
208 PartialContent = 206,
211 MultipleChoices = 300,
212 MovedPermanently = 301,
213 MovedTemporarily = 302,
214 NotModified = 304,
217 BadRequest = 400,
218 Unauthorized = 401,
219 Forbidden = 403,
220 NotFound = 404,
221 RangeNotSatisfiable = 407,
224 InternalServerError = 500,
225 NotImplemented = 501,
226 BadGateway = 502,
227 ServiceNotAvailable = 503,
228 GatewayTimeout = 504,
229 VersionNotSupported = 505,
232 InvalidResponse = 1000,
233 ConnectionFailed = 1001
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.
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