Hi Sergio,<br><br><div class="gmail_quote">2010/3/24 sergio_101 <span dir="ltr"><<a href="mailto:sergiolist@village-buzz.com">sergiolist@village-buzz.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
i am currently using HTTPSocket to pull data from a url...<br>
<br>
looks like this:<br>
<br>
| data |<br>
data := String<br>
fromByteArray: (HTTPSocket httpGet: anUrl).<br></blockquote><div><br></div><div>the problem here is that HTTPSocket httpGet: '' return a RWBinaryOrTextStream.</div><div><br></div><div>
To get the string, you need to send the message contents to the stream.</div><div><br></div><div>(HTTPSocket httpGet: 'json url') contents</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
i end up with a string that has my desired data (a JSON string), but,<br>
it's preceeded by this:<br></blockquote><div><br></div><div>yes because it's a stream, not a string.</div><div><br></div><div>hth, </div><div><br></div><div>Cédrick</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
'a RWBinaryOrTextStream ' '<here is the stuff i need>' ' '<br>
<br>
i am trying to lop off the first part by doing:<br>
<br>
jsonData := dataString replaceAll: 'RWBinaryOrTextStream' with: 'test'.<br>
<br>
just to see if i can touch the string..<br>
<br>
but no matter what i do, i can't get any parts of the string to be raplaced..<br>
<br>
it almost looks like there are three strings in there..<br>
<br>
the RWBinaryOrTextStream one, the one i need, and an empty one..<br>
<br>
is there a better way to pull a url?<br>
<br>
thanks!<br>
<br>
<br>
--<br>
<br>
----<br>
peace,<br>
sergio<br>
photographer, journalist, visionary<br>
<br>
<a href="http://www.coffee-black.com" target="_blank">http://www.coffee-black.com</a><br>
<a href="http://www.painlessfrugality.com" target="_blank">http://www.painlessfrugality.com</a><br>
<a href="http://www.twitter.com/sergio_101" target="_blank">http://www.twitter.com/sergio_101</a><br>
<a href="http://www.facebook.com/sergio101" target="_blank">http://www.facebook.com/sergio101</a><br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Cédrick <br>