Next21Team / AmxxCurl

Curl module for amxmodx
MIT License
33 stars 12 forks source link

Response body in requestComplete #6

Closed budziam closed 5 years ago

budziam commented 5 years ago

Hi, I'm trying to use this library in my project, but unfortunately I stucked.

I would like to have access to response body in requestComplete callback without using global variables.

My code looks like this:

new CURL: handle = curl_easy_init();
curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, "@responseWrite");
curl_easy_perform(handle, "@requestComplete");

@responseWrite(const data[], const size, const nmemb)
{
    return size * nmemb;
}

@requestComplete(CURL: curl, CURLcode: code)
{
    // TODO: Have access to data from responseWrite
}

Can you help me with implementation?

Polarhigh commented 5 years ago

Hi! This module does not have such functionality, for now. You can try to use gRIP

budziam commented 5 years ago

Thank you for your response. I ended up with a global responses pool.