On 16 Nov 2011, at 18:32, Lukas Renggli wrote:
> Zinc, and it is included with Pharo.
>
>
http://homepage.mac.com/svc/Zinc-HTTP-Components/getting-started.htmlIndeed, the new ZnClient can do transparent encoding/decoding using the #contentReader: and #contentWriter: options, like this:
ZnClient new
systemPolicy;
url: '
http://easy.t3-platform.net/rest/geo-ip'; queryAt: 'address' put: '81.83.7.35';
accept: ZnMimeType applicationJson;
contentReader: [ :entity | | parserClass |
parserClass := Smalltalk at: #JSJsonParser ifAbsent: [ ^ self ].
parserClass parse: entity contents ];
ifFail: [ ^ self error: 'Oops' ];
get.
If you set a #contentWriter: to convert Smalltalk to your representation, you can provide put/post data using #contents: with Smalltalk objects as arguments. The same can be done for XML, or any other (custom) encoding.
Sven_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside