cpp-ipfs-http-client: ipfs::http::Transport Class Reference

cpp-ipfs-http-client IPFS C++ client library

Public Member Functions | List of all members
ipfs::http::Transport Class Referenceabstract

Convenience interface for talking basic HTTP. More...

`#include <ipfs/http/transport.h>`

Inheritance diagram for ipfs::http::Transport:

## Public Member Functions
virtual | ~Transport ()
| Destructor.
virtual void | Fetch (const std::string &url, const std::vector< FileUpload > &files, std::iostream *response)=0
| Fetch the contents of a given URL. More...
virtual void | UrlEncode (const std::string &raw, std::string *encoded)=0
| URL encode a string. More...

## Detailed Description

Convenience interface for talking basic HTTP.

## Member Function Documentation

## ◆ Fetch()

virtual void ipfs::http::Transport::Fetch | ( | const std::string & | url,
|  | const std::vector< FileUpload > & | files,
|  | std::iostream * | response
| ) |  |
| pure virtual

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::exception | if any error occurs including erroneous HTTP status code

Returns
  void

Parameters

  [in] | url | [in] URL to get.
  [in] | files | [in] List of files to upload.
  [out] | response | [out] Output to save the response body to.

Implemented in ipfs::http::TransportCurl.

## ◆ UrlEncode()

virtual void ipfs::http::Transport::UrlEncode | ( | const std::string & | raw,
|  | std::string * | encoded
| ) |  |
| pure virtual

URL encode a string.

Returns
  void

Parameters

  [in] | raw | [in] Input string to encode.
  [out] | encoded | [out] URL encoded result.

Implemented in ipfs::http::TransportCurl.

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

- /media/melroy/Data/Projects/cpp-ipfs-http-client/include/ipfs/http/transport.h