(C#) Transition from Http.QuickRequestParams to Http.HttpParams
Provides instructions for replacing deprecated QuickRequestParams method calls with HttpParams. Note: This example requires Chilkat v11.0.0 or greater.
Chilkat.Http http = new Chilkat.Http();
string verb = "GET";
string url = "https://example.com/";
Chilkat.JsonObject json = new Chilkat.JsonObject();
json.UpdateInt("param1",100);
json.UpdateString("param2","test");
// ------------------------------------------------------------------------
// The QuickRequestParams method is deprecated:
Chilkat.HttpResponse responseObj = http.QuickRequestParams(verb,url,json);
if (http.LastMethodSuccess == false) {
Debug.WriteLine(http.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using HttpParams.
// Your application creates a new, empty HttpResponse object which is passed
// in the last argument and filled upon success.
Chilkat.HttpResponse responseOut = new Chilkat.HttpResponse();
bool success = http.HttpParams(verb,url,json,responseOut);
if (success == false) {
Debug.WriteLine(http.LastErrorText);
return;
}
|