Unicode C++
Unicode C++
Transition from Http.QuickRequestParams to Http.HttpParams
Provides instructions for replacing deprecated QuickRequestParams method calls with HttpParams.Chilkat Unicode C++ Downloads
#include <CkHttpW.h>
#include <CkJsonObjectW.h>
#include <CkHttpResponseW.h>
void ChilkatSample(void)
{
bool success = false;
CkHttpW http;
const wchar_t *verb = L"GET";
const wchar_t *url = L"https://example.com/";
CkJsonObjectW json;
json.UpdateInt(L"param1",100);
json.UpdateString(L"param2",L"test");
// ------------------------------------------------------------------------
// The QuickRequestParams method is deprecated:
CkHttpResponseW *responseObj = http.QuickRequestParams(verb,url,json);
if (http.get_LastMethodSuccess() == false) {
wprintf(L"%s\n",http.lastErrorText());
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.
CkHttpResponseW responseOut;
success = http.HttpParams(verb,url,json,responseOut);
if (success == false) {
wprintf(L"%s\n",http.lastErrorText());
return;
}
}