Function put

Synopsis

#include <include/restclient-cpp/restclient.h>

Response put(const std::string &url, const std::string &content_type, const std::string &data)

Description

HTTP PUT method.

Parameters

url - to query

ctype - content type as string

data - HTTP PUT body

Returns
response struct

Mentioned in

Source

Lines 99-114 in source/restclient.cc. Line 56 in include/restclient-cpp/restclient.h.

RestClient::Response RestClient::put(const std::string& url,
                                     const std::string& ctype,
                                     const std::string& data) {
#if __cplusplus >= 201402L
  auto conn = std::make_unique<RestClient::Connection>("");
  conn->AppendHeader("Content-Type", ctype);
  return conn->put(url, data);
#else
  RestClient::Response ret;
  RestClient::Connection *conn = new RestClient::Connection("");
  conn->AppendHeader("Content-Type", ctype);
  ret = conn->put(url, data);
  delete conn;
  return ret;
#endif
}





Add Discussion as Guest

Log in