|
| HTTPClient (bool ssl=false, HTTPClient::Version version=HTTPClient::Version::v_11, const std::string &userAgent="giris_supportlib_http_client", const std::string &contentType="application/x-www-form-urlencoded", const std::map< std::string, std::string > &customHead={}) |
|
void | setUserAgentString (const std::string &userAgent) |
|
void | setContentType (const std::string &contentType) |
|
void | setVersion (const HTTPClient::Version v) |
|
void | setSSL (bool ssl) |
|
void | setCustomHead (std::map< std::string, std::string > customHead) |
|
std::string | getUserAgentString () const |
|
std::string | getContentType () const |
|
HTTPClient::Version | getVersion () const |
|
bool | getSSL () const |
|
boost::system::error_code | getError () const |
|
std::map< std::string, std::string > | getCustomHead () const |
|
std::vector< char > | HTTPGet (const std::string &host, const std::string &port, const std::string &target="/") |
|
std::vector< char > | HTTPDelete (const std::string &host, const std::string &port, const std::string &target="/") |
|
std::vector< char > | HTTPPost (const std::string &host, const std::string &port, const std::string &target, const std::vector< char > &data) |
|
std::vector< char > | HTTPPost (const std::string &host, const std::string &port, const std::string &target, const Blob &data) |
|
std::vector< char > | HTTPPut (const std::string &host, const std::string &port, const std::string &target, const std::vector< char > &data) |
|
std::vector< char > | HTTPPut (const std::string &host, const std::string &port, const std::string &target, const Blob &data) |
|
Simple HTTP Client.
Example Usage:
#include <iostream>
#include <string>
int main()
{
HTTPClient::SPtr httpc = std::make_shared<HTTPClient>(true);
Blob b;
b = httpc->HTTPGet("www.google.at", "443");
std::cout << b.toString() << std::endl;
Blob postData;
postData.loadString("&Hello=World");
httpc->setSSL(false);
b = httpc->HTTPPost("ptsv2.com", "80", "/t/cu0dm-1579047674/post", postData);
std::cout << b.toString() << std::endl;
return EXIT_SUCCESS;
}
Binary large object implementation using std::vector<char>.
Simple HTTP Client implementation.
Namespace for giri's C++ support library.
Definition: Base64.h:47