17 #ifndef __NUGU_HTTP_REST_H__
18 #define __NUGU_HTTP_REST_H__
26 namespace NuguClientKit {
78 bool addHeader(
const std::string& key,
const std::string& value);
125 bool get(
const std::string& path,
160 bool post(
const std::string& path,
const std::string& body,
195 bool put(
const std::string& path,
const std::string& body,
227 bool del(
const std::string& path,
236 struct pending_async_data {
NUGU HTTP Rest.
Definition: nugu_http_rest.hh:42
bool get(const std::string &path, const NuguHttpHeader *additional_header, ResponseCallback cb)
HTTP GET async requests.
bool removeHeader(const std::string &key)
Remove a key-value from common header.
NuguHttpResponse * post(const std::string &path, const std::string &body, const NuguHttpHeader *additional_header=nullptr)
HTTP POST requests.
NuguHttpResponse * del(const std::string &path, const NuguHttpHeader *additional_header=nullptr)
HTTP DELETE requests.
bool put(const std::string &path, const std::string &body, ResponseCallback cb)
HTTP PUT async requests.
bool del(const std::string &path, ResponseCallback cb)
HTTP DELETE async requests.
bool post(const std::string &path, const std::string &body, const NuguHttpHeader *additional_header, ResponseCallback cb)
HTTP POST async requests.
bool del(const std::string &path, const NuguHttpHeader *additional_header, ResponseCallback cb)
HTTP DELETE async requests.
std::function< void(const NuguHttpResponse *resp)> ResponseCallback
Callback prototype for receiving async response.
Definition: nugu_http_rest.hh:50
bool get(const std::string &path, ResponseCallback cb)
HTTP GET async requests.
NuguHttpResponse * put(const std::string &path, const std::string &body, const NuguHttpHeader *additional_header=nullptr)
HTTP PUT requests.
void setTimeout(long msecs)
Set timeout to host.
bool put(const std::string &path, const std::string &body, const NuguHttpHeader *additional_header, ResponseCallback cb)
HTTP PUT async requests.
NuguHttpResponse * get(const std::string &path, const NuguHttpHeader *additional_header=nullptr)
HTTP GET requests.
bool addHeader(const std::string &key, const std::string &value)
Add a key-value string to common header.
std::string getUrl()
Get the url of host.
bool post(const std::string &path, const std::string &body, ResponseCallback cb)
HTTP POST async requests.
void setConnectionTimeout(long msecs)
Set connection timeout to host.
std::string findHeader(const std::string &key)
Find a value for key from common header.
struct _nugu_http_header NuguHttpHeader
HTTP Header object.
Definition: nugu_http.h:46
struct _nugu_http_request NuguHttpRequest
HTTP Request object.
Definition: nugu_http.h:51
struct _nugu_http_host NuguHttpHost
HTTP Host object.
Definition: nugu_http.h:41
HTTP Response object.
Definition: nugu_http.h:72