Jason's Google Code-in Blog

GCI Organization: FOSSASIA

REST API with Teapot

smalltalk

Today, my task was to write a REST API in Pharo using the Teapot framework. Teapot is a packaged designed to make making REST APIs with Pharo A LOT easier than writing a REST API from scratch in Zinc. For example, to output Hello World when a user navigates to /hello, this is all the code that is needed: Teapot on GET: '/welcome' -> 'Hello World!'; start. I wrote a package named UserAPI on SmallTalkHub that relies on the ContactManager package here to retrieve a list of users and display it as JSON in the browser after a user navigates to /users.

24 Jan 2016 #smalltalk #pharo #teapot #squeak #rest #api #zinc