Deployed db7057d
with MkDocs version: 1.2.3
This commit is contained in:
@ -571,11 +571,21 @@ bool async = true;
|
||||
HttpClient httpClient(async);
|
||||
auto args = httpClient.createRequest(url, HttpClient::kGet);
|
||||
|
||||
// If you define a chunk callback it will be called repeteadly with the
|
||||
// incoming data. This allows to process data on the go or write it to disk
|
||||
// instead of accumulating the data in memory.
|
||||
args.onChunkCallback = [](const std::string& data)
|
||||
{
|
||||
// process data
|
||||
};
|
||||
|
||||
// Push the request to a queue,
|
||||
bool ok = httpClient.performRequest(args, [](const HttpResponsePtr& response)
|
||||
{
|
||||
// This callback execute in a background thread. Make sure you uses appropriate protection such as mutex
|
||||
auto statusCode = response->statusCode; // acess results
|
||||
|
||||
// response->body is empty if onChunkCallback was used
|
||||
}
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user