![]() |
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
How to Examine the HTTP Header + Body for a POST to be sentThis example shows how to use GenerateRequestText to get the HTTP request (headers + body) that would be sent if SynchronousRequest was called with the HTTP request object. Important: The hostnames and paths in this examples are not intended to be real examples. You should replace all hostnames, paths, etc. with valid data for your own Web service.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% set req = Server.CreateObject("Chilkat_9_5_0.HttpRequest") set http = Server.CreateObject("Chilkat_9_5_0.Http") ' Any string unlocks the component for the 1st 30-days. success = http.UnlockComponent("30-day trial") If (success <> 1) Then Response.Write http.LastErrorText & "<br>" End If ' Build an XMLHTTP request. The XML passed to UseXmlHttp is sent ' in the body of the request. req.UseXmlHttp "<test>This is the XML to be sent</test>" req.Path = "/protus/xmlwebservices/xmlsubmitter/messaging.asmx" ' Add a custom header: req.AddHeader "SOAPAction","https://www.notarealdomain.com/WebServices/Messaging/2005/2/SendSingleFax" requestText = req.GenerateRequestText() Response.Write Server.HTMLEncode( requestText) & "<br>" Response.Write Server.HTMLEncode( "----------------------") & "<br>" ' Send the HTTP POST and get the response. Note: This is a blocking call. ' The method does not return until the full HTTP response is received. Set resp = http.SynchronousRequest("www.notarealdomain.com",443,1,req) If (resp Is Nothing ) Then Response.Write Server.HTMLEncode( http.LastErrorText) & "<br>" Else ' Display the body of the response. Response.Write Server.HTMLEncode( resp.BodyStr) & "<br>" End If %> </body> </html> |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.