Sample code for 30+ languages & platforms
Xbase++ Requires Chilkat v11.0.0+

Transition from Http.GetHead to Http.HttpNoBody

Provides instructions for replacing deprecated GetHead method calls with HttpNoBody.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL cUrl
LOCAL oResp1
LOCAL oResp2

nSuccess := 0

oHttp := CreateObject("Chilkat.Http")
cUrl := "https://www.example.com/"

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

oResp1 := oHttp:GetHead(cUrl)
IF (oHttp:LastMethodSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    RETURN
ENDIF

? Str(oResp1:StatusCode)
oResp1:destroy()

//  ------------------------------------------------------------------------
//  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.

oResp2 := CreateObject("Chilkat.HttpResponse")
nSuccess := oHttp:HttpNoBody("HEAD", cUrl, oResp2)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oResp2:destroy()
    RETURN
ENDIF

? Str(oResp2:StatusCode)

oHttp:destroy()
oResp2:destroy()