lib/curl/Handler: add API documentation
This commit is contained in:
@@ -36,12 +36,34 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asynchronous response handler for a #CurlRequest.
|
||||||
|
*
|
||||||
|
* Its methods must be thread-safe.
|
||||||
|
*/
|
||||||
class CurlResponseHandler {
|
class CurlResponseHandler {
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* Status line and headers have been received.
|
||||||
|
*/
|
||||||
virtual void OnHeaders(unsigned status,
|
virtual void OnHeaders(unsigned status,
|
||||||
std::multimap<std::string, std::string> &&headers) = 0;
|
std::multimap<std::string, std::string> &&headers) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response body data has been received.
|
||||||
|
*/
|
||||||
virtual void OnData(ConstBuffer<void> data) = 0;
|
virtual void OnData(ConstBuffer<void> data) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The response has ended. The method is allowed delete the
|
||||||
|
* #CurlRequest here.
|
||||||
|
*/
|
||||||
virtual void OnEnd() = 0;
|
virtual void OnEnd() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An error has occurred. The method is allowed delete the
|
||||||
|
* #CurlRequest here.
|
||||||
|
*/
|
||||||
virtual void OnError(std::exception_ptr e) noexcept = 0;
|
virtual void OnError(std::exception_ptr e) noexcept = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user