| 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.
Example:
<%
Response.ContentType = "image/gif"
Set HTTPObj = Server.CreateObject("AspHTTP.Conn")
HTTPObj.Url = "http://www.microsoft.com/library/images/gifs/toolbar/write.gif"
HTTPObj.GetURL
Response.BinaryWrite HTTPObj.BinaryData
%>
|
| ContentType |
The
ContentType property allows you to specify custom content-type
headers during a POST operation.
Example:
ContentType
= "application/x-www-form-urlencoded"
|
| Error |
Reports
any errors that may occur during the request. |
| FollowRedirects |
FollowRedirects
tells the component to follow redirect responses from the HTTP
server.
Example:
HTTPObj.FollowRedirects
= true
|
| Headers |
The
Headers property contains the response headers from the HTTP
request after the request has been completed by a call to the
GetURL method.
Example:
Response.Write
HTTPObj.Headers
|
| HTTPLog |
Filename
where HTTP transaction data can be logged.
Example:
HTTPObj.HTTPLog
= "c:\httplog.txt"
|
| MaxRedirects |
Sets
the maximum number of times an HTTP redirection will be allowed.
The default value is 3. (version >= 3.51). |
| Port |
The
Port property indicates which port to contact the HTTP server
on.
Example:
HTTPObj.Port
= 80
|
| PostData |
The
PostData property should be set to the values of the data that
you want to post to the server for a post request.
Example:
HTTPObj.PostData
= "suid=jimb&act=upd"
|
| Protocol |
The
Protocol property indicates what version of HTTP the request
should be made using. By default Protocol is HTTP/1.0
Example:
HTTPObj.Protocol
= "HTTP/1.1"
|
| Proxy |
The
proxy property contains the address and port of the proxy server
seperated by a colon.
Example:
HTTPObj.Proxy
= "address.net:2001"
|
| ProxyPassword |
Sets
the HTTP Proxy password for HTTP proxy servers that require
authentication. Only basic authentication is currently supported. |
| RequestMethod |
The
RequestMethod property indicates what type of HTTP request should
be made to the server. Legal values are "GET", "POST"
and "HEAD".
Example:
HTTPObj.RequestMethod
= "POST"
|
| RegisteredUser |
The
RegisteredUser property indicates the name the component is
licensed to.
Example:
Response.Write
"This component is licensed to " & HTTPObj.RegisteredUser
|
| Response |
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
|
| 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.
HTTPObj.AddExtraHeader
("Cookie: ASPSESSIONID=EKKDDPSDKCCPZRNA; path=/kb")
|
| ClearExtraHeaders |
None |
None |
Clears
any HTTP request headers that were set using AddExtraHeader. |
| GetHeader |
String |
String |
Get's
the value of a specific header after GetURL has been called.
If multiple headers have the same value GetHeader returns the
first. To search all headers see GetHeaders.
Example:
strCookie
= HTTPObj.GetHeader("Set-Cookie")
You
could then on subsequent calls return the same cookie as follows:
if
strCookie <> "" then
HTTPObj.AddExtraHeader "Cookie: " & strCookie
end if
|
| GetHeaders |
None |
String |
Returns
all Header values for manual parsing. Header values are CrLf
separated. |
| GetHREFs |
None |
Variant
array of Strings |
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. |
| URLDecode |
strValue |
String |
Decodes
an URL encoded string |
| URLEncode |
strValue |
String |
Encodes
an string to a legal URL value.
Example:
HTTPObj.URL
= HTTPObj.URLEncode("http://www.test_xyz.com?avalue=this
is a value with spaces")
|