Calling REST APIs from Squeak

David Shaffer cdshaffer at acm.org
Fri Mar 23 22:30:06 UTC 2007


Benjamin Pollack wrote:
> I was talking to the author of a book on REST the other day, and 
> noticed that neither HTTPClient nor HTTPSocket really seem to support 
> REST APIs. At a bare minimum, I think you'd probably want the ability 
> to add arbitrary headers to GET/PUT/POST (which HTTPSocket doesn't 
> allow) and the ability to issue DELETE commands. For example, Amazon's 
> APIs require an Authorization: header, and writing a clean WebDAV 
> client that didn't duplicate a huge chunk of HTTPSocket functionality 
> would be impossible at the moment. I'd be happy to submit a changeset 
> refactoring HTTPSocket to make this more feasible, but I wanted to 
> verify that I'm not either misunderstanding how these classes are 
> supposed to be used or missing existing functionality already in the 
> image.
>
> Cheers,
> --Benjamin
> ------------------------------------------------------------------------
>
>
>   
I keep a version of the "SWHTTPClient" library around just for this 
purpose.  It has all of the capabilities that you described.  I've used 
it to build several rest-ful clients.  I'm not sure where I originally 
got it.  I thought that the port was from Avi.  Anyway I've modified it 
only slightly to make it interface in a better way with Squeak's socket 
timeout semantics.  If anyone wants the modified version, or if this 
software is being maintained somewhere, I'd be happy to merge in my changes.

David




More information about the Squeak-dev mailing list