cpp-ipfs-http-client
IPFS C++ client library
|
Convenience interface for talking basic HTTP. More...
#include <ipfs/http/transport.h>
Public Member Functions | |
virtual std::unique_ptr< Transport > | Clone () const =0 |
Return a deep copy of this object. | |
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. | |
virtual void | StopFetch ()=0 |
Stop the Fetch method abruptly. | |
virtual void | ResetFetch ()=0 |
Reset the internal state, after StopFetch() is called. | |
virtual void | UrlEncode (const std::string &raw, std::string *encoded)=0 |
URL encode a string. | |
Convenience interface for talking basic HTTP.
|
pure virtual |
Return a deep copy of this object.
Implemented in ipfs::http::TransportCurl.
|
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".
Fetch method is thread-safe. Therefor, can be used within a thread.
std::exception | if any error occurs including erroneous HTTP status code |
[in] | url | URL to get. |
[in] | files | List of files to upload. |
[out] | response | Output to save the response body to. |
Implemented in ipfs::http::TransportCurl.
|
pure virtual |
Reset the internal state, after StopFetch() is called.
This method needs to be called once the thread is fully finished. Ideally after client.abort() and thread.join() methods.
Call this method out-side of the running thread, eg. the main thread.
Implemented in ipfs::http::TransportCurl.
|
pure virtual |
Stop the Fetch method abruptly.
When the Fetch method is used within a thead, but you want to stop the thread (without using pthread_cancel).
Call this method out-side of the running thread, eg. the main thread.
Implemented in ipfs::http::TransportCurl.
|
pure virtual |
URL encode a string.
URLEcode method is thread-safe.
[in] | raw | Input string to encode. |
[out] | encoded | URL encoded result. |
Implemented in ipfs::http::TransportCurl.