![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) Transition from Http.GetHead to Http.HttpNoBodyProvides instructions for replacing deprecated GetHead method calls with HttpNoBody. Note: This example requires Chilkat v11.0.0 or greater.
Use ChilkatAx-win32.pkg Procedure Test Handle hoHttp String sUrl Variant vResp1 Handle hoResp1 Variant vResp2 Handle hoResp2 Boolean iSuccess String sTemp1 Integer iTemp1 Boolean bTemp1 Get Create (RefClass(cComChilkatHttp)) To hoHttp If (Not(IsComObjectCreated(hoHttp))) Begin Send CreateComObject of hoHttp End Move "https://www.example.com/" To sUrl // ------------------------------------------------------------------------ // The GetHead method is deprecated: Get ComGetHead Of hoHttp sUrl To vResp1 If (IsComObject(vResp1)) Begin Get Create (RefClass(cComChilkatHttpResponse)) To hoResp1 Set pvComObject Of hoResp1 To vResp1 End Get ComLastMethodSuccess Of hoHttp To bTemp1 If (bTemp1 = False) Begin Get ComLastErrorText Of hoHttp To sTemp1 Showln sTemp1 Procedure_Return End Get ComStatusCode Of hoResp1 To iTemp1 Showln iTemp1 Send Destroy of hoResp1 // ------------------------------------------------------------------------ // 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. Get Create (RefClass(cComChilkatHttpResponse)) To hoResp2 If (Not(IsComObjectCreated(hoResp2))) Begin Send CreateComObject of hoResp2 End Get pvComObject of hoResp2 to vResp2 Get ComHttpNoBody Of hoHttp "HEAD" sUrl vResp2 To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoHttp To sTemp1 Showln sTemp1 Procedure_Return End Get ComStatusCode Of hoResp2 To iTemp1 Showln iTemp1 End_Procedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.