![]() |
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) Inspect HTTP Request HeaderDemonstrates the
Use ChilkatAx-win32.pkg Procedure Test Boolean iSuccess Handle hoHttp String sUrl String sJson Variant vResp Handle hoResp String sTemp1 Move False To iSuccess Get Create (RefClass(cComChilkatHttp)) To hoHttp If (Not(IsComObjectCreated(hoHttp))) Begin Send CreateComObject of hoHttp End Move "https://chilkatsoft.com/echo_request_body.asp" To sUrl Move '{"greeting":"Hello World"}' To sJson // Send a POST with the JSON in the HTTP request body. Get Create (RefClass(cComChilkatHttpResponse)) To hoResp If (Not(IsComObjectCreated(hoResp))) Begin Send CreateComObject of hoResp End Get pvComObject of hoResp to vResp Get ComHttpStr Of hoHttp "POST" sUrl sJson "utf-8" "application/json" vResp To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoHttp To sTemp1 Showln sTemp1 Procedure_Return End // Examine the HTTP request header we just sent. Get ComLastHeader Of hoHttp To sTemp1 Showln sTemp1 // Output: // POST /echo_request_body.asp HTTP/1.1 // Host: chilkatsoft.com // Accept: */* // Accept-Encoding: gzip // Content-Type: application/json // Content-Length: 26 End_Procedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.