How to check file url (smth like isFileExists) in seaside (in case the file is not on localhost)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to check file url (smth like isFileExists) in seaside (in case the file is not on localhost)

Micael Alastor
Hello, sorry for my ugly English =) .

How can I check the existence of the file www.qwerty.com/someFile.jpg ?
May be I need to write smth like that: 

request := WARequest
method: 'GET'
headers: Dictionary new
fields: Dictionary new
cookies: Dictionary new.
response := aHandler handleRequest: request.
self assert: response status = 200.
.......
??
But I don't know type of handler I must use for such request.
Any ideas?

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to check file url (smth like isFileExists) in seaside (in case the file is not on localhost)

Lukas Renggli
> How can I check the existence of the file www.qwerty.com/someFile.jpg ?
> May be I need to write smth like that:
> request := WARequest
> method: 'GET'
> url: 'www.qwerty.com/someFile.jpg'
> headers: Dictionary new
> fields: Dictionary new
> cookies: Dictionary new.
> response := aHandler handleRequest: request.
> self assert: response status = 200.
> .......
> ??
> But I don't know type of handler I must use for such request.
> Any ideas?

Seaside is a web application server, not a web client. It does not
provide the functionality to perform requests, it only handles them.
Instances of the class WARequest is used internally by Seaside to
represent the incoming requests in a platform and server independent
way.

Check the libraries provided by your Smalltalk dialect. In
Pharo/Squeak this is the class HttpSocket.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside