如何 return 来自 curl 多句柄的响应 C++ libcurl

how to return a response from a curl multi handle c++ libcurl

php 有 multi_get_content(),但我没有看到任何明确的方法来在完成时从多传输中检索响应。我只能使用 CURLMsg* 变量 (msg->data.result).

从中检索 CURLcode

使用 CURLOPT_WRITEFUNCTION option to setup a callback that receives all incoming data and stores it appropriately. An example of such callback that stores the entire response in memory is getinmemory.c(虽然该示例使用简单接口,但回调的工作方式与多接口完全相同。)