Sample code for 30+ languages & platforms
C++

Transition from Http.QuickRequestParams to Http.HttpParams

Provides instructions for replacing deprecated QuickRequestParams method calls with HttpParams.

Chilkat C++ Downloads

C++
#include <CkHttp.h>
#include <CkJsonObject.h>
#include <CkHttpResponse.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkHttp http;

    const char *verb = "GET";
    const char *url = "https://example.com/";

    CkJsonObject json;
    json.UpdateInt("param1",100);
    json.UpdateString("param2","test");

    //  ------------------------------------------------------------------------
    //  The QuickRequestParams method is deprecated:

    CkHttpResponse *responseObj = http.QuickRequestParams(verb,url,json);
    if (http.get_LastMethodSuccess() == false) {
        std::cout << http.lastErrorText() << "\r\n";
        return;
    }

    //  ...
    //  ...

    delete responseObj;

    //  ------------------------------------------------------------------------
    //  Do the equivalent using HttpParams.
    //  Your application creates a new, empty HttpResponse object which is passed 
    //  in the last argument and filled upon success.

    CkHttpResponse responseOut;
    success = http.HttpParams(verb,url,json,responseOut);
    if (success == false) {
        std::cout << http.lastErrorText() << "\r\n";
        return;
    }
    }