Unicode C++
Unicode C++
Transition from Http.QuickPutStr to Http.HttpNoBody
Provides instructions for replacing deprecated QuickPutStr method calls with HttpNoBody.Chilkat Unicode C++ Downloads
#include <CkHttpW.h>
#include <CkHttpResponseW.h>
void ChilkatSample(void)
{
bool success = false;
CkHttpW http;
// ...
// ...
const wchar_t *url = L"https://example.com/test";
// ------------------------------------------------------------------------
// The QuickPutStr method is deprecated:
const wchar_t *responseBody = http.quickPutStr(url);
if (http.get_LastMethodSuccess() == false) {
wprintf(L"%s\n",http.lastErrorText());
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using HttpNoBody.
// Your application creates a new, empty HttpResponse object which is passed
// in the last argument and filled upon success.
CkHttpResponseW responseOut;
success = http.HttpNoBody(L"PUT",url,responseOut);
if (success == false) {
wprintf(L"%s\n",http.lastErrorText());
return;
}
responseBody = responseOut.bodyStr();
}