[Newbies] problems pulling data from a url..
cdrick65 at gmail.com
Wed Mar 24 09:52:55 UTC 2010
2010/3/24 sergio_101 <sergiolist at village-buzz.com>
> i am currently using HTTPSocket to pull data from a url...
> looks like this:
> | data |
> data := String
> fromByteArray: (HTTPSocket httpGet: anUrl).
the problem here is that HTTPSocket httpGet: '' return
To get the string, you need to send the message contents to the stream.
(HTTPSocket httpGet: 'json url') contents
> i end up with a string that has my desired data (a JSON string), but,
> it's preceeded by this:
yes because it's a stream, not a string.
> 'a RWBinaryOrTextStream ' '<here is the stuff i need>' ' '
> i am trying to lop off the first part by doing:
> jsonData := dataString replaceAll: 'RWBinaryOrTextStream' with: 'test'.
> just to see if i can touch the string..
> but no matter what i do, i can't get any parts of the string to be
> it almost looks like there are three strings in there..
> the RWBinaryOrTextStream one, the one i need, and an empty one..
> is there a better way to pull a url?
> photographer, journalist, visionary
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners