C++
C++
Transition from Http.QuickPutStr to Http.HttpNoBody
Provides instructions for replacing deprecated QuickPutStr method calls with HttpNoBody.Chilkat C++ Downloads
#include <CkHttp.h>
#include <CkHttpResponse.h>
void ChilkatSample(void)
{
bool success = false;
CkHttp http;
// ...
// ...
const char *url = "https://example.com/test";
// ------------------------------------------------------------------------
// The QuickPutStr method is deprecated:
const char *responseBody = http.quickPutStr(url);
if (http.get_LastMethodSuccess() == false) {
std::cout << http.lastErrorText() << "\r\n";
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.
CkHttpResponse responseOut;
success = http.HttpNoBody("PUT",url,responseOut);
if (success == false) {
std::cout << http.lastErrorText() << "\r\n";
return;
}
responseBody = responseOut.bodyStr();
}