AspHTTP 3.x

About AspHTTP

AspHTTP allows you to GET/POST/HEAD documents using the HTTP
protocol.

Features include:

GET, HEAD and POST request methods

Response headers are exposed

Accept headers are modifiable

Adjustable timeout

Proxy support

Custom User-Agent headers

Custom Content-Type headers for POST

Redirection

Supports authentication areas (Basic only, NOT
NTLM)

Retrieves URLs to a file including binary files

Allows custom HTTP request headers

Changes in AspHTTP 3.5

Better support for MTS. Transactions are not supported in the 3.0
release but you should be able to incorporate AspHTTP into MTS packages without any
problems. 3.5 also has performance optimizations over 3.0.

AspHTTP Installation

To use this ASP component move the DLL into a subdirectory
(like \winnt\system32 for NT or \windows\system for Win95). Change to the directory where you move the
DLL before registering the component.

Installing Upgrades

Stop all IIS related services such as Gopher, FTP and W3SVC.
Uninstalling the old DLL is not necessary. If the DLL has been loaded you will get an
error message saying the file is in use by another process. Stop that process and then
copy the file. Restart the necessary services.

Technical Support

AspHTTP Properties

Accept

The Accept property indicates what kind of
MIME types can be accepted by the requesting program.

Example:

HTTPObj.Accept = "*/*"

Authorization

The Authorization header allows you to retrieve URLs that are
located in authenticated areas. To use the Authorization property set this property to the
username and password, seperated by a colon ":", for the password protected
area.

Example:

HTTPObj.Authorization = "jimb:superbmr"

BinaryData

Returns the data available from the GetURL request in binary form.
You can use this property to grab binary data such as images off another server.

The Response property contains the HTTP response after a request
has been received from a Web server.

SaveFileTo

The SaveFileTo allows you to retrieve files of any type and have
them automatically saved to a local server disk. This allows you to retrieve binary files such as
images, as well as text files, like HTML files. To use the SaveFileTo property set the
value of SaveFileTo to the name of the local directory and file name where the requested
URL should be saved. Be sure the user has security rights that allow the writing of the
file. Set this property before the call to GetURL if you wish to
save to a file.

Example:

HTTPObj.SaveFileTo = "c:\images\3rdqrtr.jpg"

TimeOut

The timeout property determines how long
the component should wait for a response from the HTTP server. The
default timeout is 60 seconds.

Example:

HTTPObj.TimeOut = 45

URL

The URL property should be set to the URL
you wish the request to operate upon. URLs should be preceded with http://.

Example:

HTTPObj.URL =
"http://www.myfinancial.com/scripts/update3.asp"

UserAgent

The UserAgent property allows the
component to impersonate browsers by sending a UserAgent header in the request.

Example:

HTTPObj.UserAgent = "Mozilla Compatible (MS IE 3.01
WinNT)"

Version

The version property indicates the
internal version of the AspHTTP component.

Example:

Response.Write "The component version is " &
HTTPObj.Version

AspHTTP Component Methods

Method

Parameters

Return Value

Description

GetURL

None

String

GetURL returns the reponse of the HTTP
request. This value is a string value and the component currently does not support binary
return values such as GIF or JPEG images.

AddExtraHeader

String

None

Adds a custom HTTP header to the request. Custom headers may
include simulated browser headers such as IE's display resolution headers.

After a call to GetURL you can call GetHREFs to parse any <a
href=""> tags in the HTML. GetHREFs returns a variant array of strings that
you can further parse or display. See HREFList.asp for example code that uses this method.
GetHREFs was added in version 2.4.