Sample code for 30+ languages & platforms
C#

Transition from Http.GetHead to Http.HttpNoBody

Provides instructions for replacing deprecated GetHead method calls with HttpNoBody.

Chilkat C# Downloads

C#
bool success = false;

Chilkat.Http http = new Chilkat.Http();
string url = "https://www.example.com/";

//  ------------------------------------------------------------------------
//  The GetHead method is deprecated:

Chilkat.HttpResponse resp1 = http.GetHead(url);
if (http.LastMethodSuccess == false) {
    Debug.WriteLine(http.LastErrorText);
    return;
}

Debug.WriteLine(Convert.ToString(resp1.StatusCode));

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

Chilkat.HttpResponse resp2 = new Chilkat.HttpResponse();
success = http.HttpNoBody("HEAD",url,resp2);
if (success == false) {
    Debug.WriteLine(http.LastErrorText);
    return;
}

Debug.WriteLine(Convert.ToString(resp2.StatusCode));