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.
204 Ok = 200,
205 Created = 201,
206 Accepted = 202,
207 NoContent = 204,
208 ResetContent = 205,
209 PartialContent = 206,
212 MultipleChoices = 300,
213 MovedPermanently = 301,
214 MovedTemporarily = 302,
215 NotModified = 304,
218 BadRequest = 400,
219 Unauthorized = 401,
220 Forbidden = 403,
221 NotFound = 404,
222 RangeNotSatisfiable = 407,
225 InternalServerError = 500,
226 NotImplemented = 501,
227 BadGateway = 502,
228 ServiceNotAvailable = 503,
229 GatewayTimeout = 504,
230 VersionNotSupported = 505,
233 InvalidResponse = 1000,
235 };
Request(const std::string &uri="/", Method method=Get, const std::string &body="")
Default constructor.
void setHttpVersion(unsigned int major, unsigned int minor)
Set the HTTP version for the request.
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.
Utility class that makes any derived class non-copyable.
Definition NonCopyable.hpp:42
Definition AlResource.hpp:35