18 #ifndef ION_REMOTE_HTTPCLIENT_H_
19 #define ION_REMOTE_HTTPCLIENT_H_
24 #include "base/integral_types.h"
39 explicit Url(
const std::string& url);
41 void Set(
const std::string& url);
57 std::map<std::string, std::string>
args;
71 std::map<std::string, std::string>
headers;
78 virtual const Response Get(
const std::string& url)
const;
84 virtual const Response Head(
const std::string& url)
const;
86 virtual const Response Post(
const std::string& url,
const std::string& data);
88 virtual const Response Put(
const std::string& url,
const std::string& data);
94 #endif // ION_REMOTE_HTTPCLIENT_H_
virtual const Response Head(const std::string &url) const
Sends a HEAD request for a URL and returns the remote host's response.
Url url
The requested Url that produced the response.
std::map< std::string, std::string > headers
Headers returned by the remote host.
Simple wrapper around a URL.
virtual const Response GetRange(const std::string &url, int64 start, int64 end) const
Sends a GET request for the passed byte range and returns the remote host's response.
virtual const Response Put(const std::string &url, const std::string &data)
PUTs data to URL and returns the remote host's response.
virtual const Response Get(const std::string &url) const
Sends a GET request for a URL and returns the remote host's response.
Url()
Constructs an empty, invalid Url.
bool is_https
Whether the connection is HTTPS or HTTP.
std::string data
Data received from the last interaction with the remote host.
std::string hostname
The remote host's name.
bool IsValid() const
Returns whether this Url is valid.
int port
The remote host's port.
std::string path
The path on the remote host.
void Set(const std::string &url)
Sets the url from the passed value.
int status
The status code received from the remote host (e.g., 200, 404);.
HttpClient is a very basic class that sends HTTP requests and returns the server's response...
virtual const Response Post(const std::string &url, const std::string &data)
POSTs data to URL and returns the remote host's response.
std::map< std::string, std::string > args
Any query arguments in the Url.