cpp-ipfs-http-client
IPFS C++ client library
Public Member Functions | List of all members
ipfs::http::TransportCurl Class Reference

Convenience class for talking basic HTTP, implemented using CURL. More...

#include <ipfs/http/transport-curl.h>

Inheritance diagram for ipfs::http::TransportCurl:
ipfs::http::Transport

Public Member Functions

 TransportCurl ()
 Constructor. More...
 
 ~TransportCurl ()
 Destructor. More...
 
void Fetch (const std::string &url, const std::vector< FileUpload > &files, std::iostream *response) override
 Fetch the contents of a given URL. More...
 
void UrlEncode (const std::string &raw, std::string *encoded) override
 URL encode a string. More...
 
void Test ()
 Test the internals that are hard to execute from the public API, like error handling of some exceptional cases. More...
 
- Public Member Functions inherited from ipfs::http::Transport
virtual ~Transport ()
 Destructor. More...
 

Detailed Description

Convenience class for talking basic HTTP, implemented using CURL.

Constructor & Destructor Documentation

◆ TransportCurl()

ipfs::http::TransportCurl::TransportCurl ( )

Constructor.

◆ ~TransportCurl()

ipfs::http::TransportCurl::~TransportCurl ( )

Destructor.

Member Function Documentation

◆ Fetch()

void ipfs::http::TransportCurl::Fetch ( const std::string &  url,
const std::vector< FileUpload > &  files,
std::iostream *  response 
)
overridevirtual

Fetch the contents of a given URL.

If any files are provided in files, they are submitted using "Content-Type: multipart/form-data".

Exceptions
std::exceptionif any error occurs including erroneous HTTP status code
Parameters
[in]urlURL to get.
[in]filesList of files to upload.
[out]responseOutput to save the response body to.

Implements ipfs::http::Transport.

◆ Test()

void ipfs::http::TransportCurl::Test ( )

Test the internals that are hard to execute from the public API, like error handling of some exceptional cases.

◆ UrlEncode()

void ipfs::http::TransportCurl::UrlEncode ( const std::string &  raw,
std::string *  encoded 
)
overridevirtual

URL encode a string.

Parameters
[in]rawInput string to encode.
[out]encodedURL encoded result.

Implements ipfs::http::Transport.


The documentation for this class was generated from the following files: