Login  
Search All Forums
Dart Home | PowerTCP Web for ActiveX | Custom Development Reply | PowerTCP Web for ActiveX Topics | Forums   
AuthorForum: PowerTCP Web for ActiveX
Topic: HTTP GET - ASP
User995

Posts: 7
Member Since: 07/04/00
posted December 12, 2000 11:39 PM

I have a couple of problems doing an HTTP get in an ASP page.

Firstly, how can I get the HTTP headers?
I've worked out that I nee:

Set ds = CreateObject("Dart.DartStrings")

and my GET looks like:

webpage = ""
http_headers = ""
HTTPObj.Get webpage, http_headers

But this aint working....how can I get the HTTP headers into a string?

Secondly, I'm checking multiple sites in a DO LOOP scenario, and it seems I have to close the object (HttpObj.close) and re-open it (Set HttpObj = Server.CreateObject("DART.HTTP")) for each item in the loop.

If I don't close and re-open the object, some variables aren't getting reset, code below:

<%
DO until rstemp.eof = TRUE

webpage = ""
strresult = ""

IF CSTR(rstemp("timeout")) = "0" then SECTIMEOUT = "3" ELSE SECTIMEOUT = CSTR(rstemp("timeout")) END IF

SECTIMEOUT = SECTIMEOUT & "000"


  HttpObj.Url = "http://" & rstemp("url") & "/http-ping.html"
  HttpObj.TimeOut = SECTIMEOUT
HTTPObj.Get webpage, http_headers
strresult = webpage


up = TRUE


strResult = Trim(strResult)

SizeOfReturn = Len(strResult)

IF SizeOfReturn < 1 THEN up = false END IF

%>

Once a url has been labelled as FALSE, all others following it are false also, and I can;t figure out why....


Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted December 12, 2000 11:52 PM


You are setting timeout to a string which evaluates to 0, meaning you are using the control in non-blocking mode, which is useless in ASP. Here is an example of a simple get:

<%
Dim Reply
Dim Http1
Set Http1 = Server.CreateObject("Dart.Http.1")
Dim Header
Set Header = Server.CreateObject("Dart.DartStrings.1")
Http1.Cache = False
Http1.Url = "http://www.dart.com"
Reply = "" ' do this to cast Reply to a string!
Http1.Get Reply, Header
Response.Write Header.All + Reply
%>
Reply | PowerTCP Web for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX