There is also the OpenAPI specification dedicated to define a REST API and from which a skeleton of an implementation can be generated. It should be then also possible to generate the skeleton of a client for such an API.

Swagger provides tooling to the OpenAPI specification for several programming languages. Unfortunately, it seams there is no implementation for Smalltalk.

Miguel


Le 05/12/2017 à 13:05, Peter Uhnák a écrit :
With ZnClient you can also dynamically extend paths (#addPath:), specify parameters (#formAt:put:, #queryAt:put:), provide raw #contents:, etc.

But what would be nice is to convert the responses to some domain objects. So e.g. when I query trello for all lists, I would like to get as a result not json, but List instances, where if I asked for cards, it would query the cards from the server.

I recommend also looking at this project by Richard Prinz https://www.min.at/prinz/?x=entry:entry150318-104537 which basically discovers the API and generates a nice implementation for it. Then you use the generated API instead of worrying about constructing HTTP requests.

Peter

On Tue, Dec 5, 2017 at 12:59 PM, Esteban Lorenzano <esteba...@gmail.com> wrote:
Hi,


On 5 Dec 2017, at 12:15, Ben Coman <b...@openinworld.com> wrote:

I'm just about to write my first client interface to a REST service.
In some respects I understand this is as simple as doing GET responses
using Zinc,

yes, is about that.
GET/POST/PUT/DELETE

all have sense. 

but I'm inquiring about tutorials or libraries that might help.  Most
of the stuff turned up by searches is about server-side of REST.

I’m currently playing with my latest fun project pharo-mastodon, http://github.com/estebanlm/pharo-mastodon (the long term project is “getting out twitter” :P). 
It is actually a rest api… and since is very young, is not complicated at all, so you can take it as an example (probably of "things not to do”, but well… ;) )

Esteban



cheers -ben




Reply via email to