Simple HTTP client

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

Simple HTTP client

Mark Carter-4
I would like to mess around with some client-side HTTP stuff. I had a  
Google around, and it appears that I need the packages Netclients.  
However, I couldn't figure out how to make it work.

Is there a simple example where I can download, for example the page www.google.com
, as a string?


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Simple HTTP client

Giuseppe
Hi Mark,

Check this:
http://smalltalk.gnu.org/faq/38

Cheers.


El 31/05/2008, a las 11:37, Mark Carter escribió:

> I would like to mess around with some client-side HTTP stuff. I had  
> a Google around, and it appears that I need the packages Netclients.  
> However, I couldn't figure out how to make it work.
>
> Is there a simple example where I can download, for example the page www.google.com
> , as a string?
>
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Simple HTTP client

Paolo Bonzini-2
In reply to this post by Mark Carter-4
Mark Carter wrote:
> I would like to mess around with some client-side HTTP stuff. I had a
> Google around, and it appears that I need the packages Netclients.
> However, I couldn't figure out how to make it work.
>
> Is there a simple example where I can download, for example the page
> www.google.com, as a string?

Uhm, in the development trees it broke recently... :-)

I don't have 3.0.3 checked out but this should work:

    [ (f := FileStream open: 'http://www.inf.unisi.ch/' mode: 'r')
         contents ] ensure: [ f close ]

I guess it'd be better to have something like

    (URL fromString: 'http://www.inf.unisi.ch/') contents

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Simple HTTP client

Paolo Bonzini-2
Paolo Bonzini wrote:
> Mark Carter wrote:
>> I would like to mess around with some client-side HTTP stuff. I had a
>> Google around, and it appears that I need the packages Netclients.
>> However, I couldn't figure out how to make it work.
>>
>> Is there a simple example where I can download, for example the page
>> www.google.com, as a string?
>
> Uhm, in the development trees it broke recently... :-)

This is fixed in a67e49c85904d58247daa8ebcc60d90ab55b7c32.

> I don't have 3.0.3 checked out but this should work:
>
>    [ (f := FileStream open: 'http://www.inf.unisi.ch/' mode: 'r')
>         contents ] ensure: [ f close ]

Yes, this works in 3.0.3.  I also checked in a couple of fixes to handle
404 errors better.  I'll send mail about one of these fixes soon...

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk