Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ Delphi FoxPro Java Perl Python Ruby SQL Server VBScript
|
HTTP HEAD RequestSimple HTTP HEAD request to download only the HTTP header. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% set http = Server.CreateObject("Chilkat.Http") ' Any string unlocks the component for the 1st 30-days. success = http.UnlockComponent("Anything for 30-day trial") If (success <> 1) Then Response.Write http.LastErrorText & "<br>" End If ' Create a HEAD request for a URL: set req = Server.CreateObject("Chilkat.HttpRequest") req.UseHead req.SetFromUrl "http://www.chilkatsoft.com/" ' Send the HEAD request and get the response. ' Call SynchronousRequest to send the HTTP request and get ' the response. ' It's seemingly dumb that you would need to specify the ' domain, port and ssl separately in the call to SynchronousRequest. ' However, in some cases the contents of the HTTP request may be different ' than the address/protocol of where it is sent. Usually this ' isn't the case. So for "http://www.chilkatsoft.com", the ' domain = "www.chilkatsoft.com", the port is 80, and we ' are not using SSL: port = 80 domain = "www.chilkatsoft.com" ssl = 0 Set response = http.SynchronousRequest(domain,port,ssl,req) If (response Is Nothing ) Then Response.Write http.LastErrorText & "<br>" Else ' Show the HTTP response code and header received. Response.Write "HTTP response code: " & "<br>" Response.Write response.StatusCode & "<br>" Response.Write "---- FULL HEADER ----" & "<br>" Response.Write response.Header & "<br>" Response.Write "---------------------" & "<br>" End If %> </body> </html> |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.