[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] NetClients.HTTP

From: Stephen
Subject: [Help-smalltalk] NetClients.HTTP
Date: Tue, 29 Mar 2011 08:52:13 +1300
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20110303 Thunderbird/3.1.9

Hi all,

I wish to monitor a web site with a script so I know if it goes down.

I hunted around in the source in packages/net, and got this to work to an onsite web server...

#!/usr/local/bin/gst -f
  PackageLoader fileInPackage: 'NetClients'.
  siteurl := 'http://localhost/index.html'.
request := NetClients.URIResolver openStreamOn: siteurl ifFail: [ Transcript show: 'Request failed'].
  Transcript show: request contents.

Now the host to be monitored is a Moodle server, but when I use the same code with the URL of the Moodle server I get an error. For instance, with code above and the siteurl below:-

siteurl := ''.   " shows same error as our site"

this is the output...
Request failedObject: TextCollector new "<0x40372180>" error: method is responsibility of a subclass SystemExceptions.SubclassResponsibility(Exception)>>signal ( SystemExceptions.SubclassResponsibility class(Exception class)>>signal (
TextCollector(Object)>>subclassResponsibility (
TextCollector(Stream)>>atEnd (
TextCollector(Stream)>>nextPutAllOn: (
TextCollector(Stream)>>upToEnd (
TextCollector(Stream)>>contents (
UndefinedObject>>executeStatements (

Help to get the body of the http response from would be much appreciated.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]