Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Representational State Transfer (REST) in Common Lisp

I am teaching myself Common Lisp and I'm creating a simple program that interfaces with facebook's graph api. Facebook uses REST and json.

This is a really simple question, but where are the REST libraries in Common Lisp? I can't seem to find it.

like image 258
Steve Quezadas Avatar asked Nov 19 '11 17:11

Steve Quezadas


2 Answers

If you want to query Facebook API and process their JSON output, you probably need Drakma (an HTTP-client) and cl-json or yason JSON-processing libraries.

like image 194
Vsevolod Dyomkin Avatar answered Oct 13 '22 00:10

Vsevolod Dyomkin


In addition to what Vsevolod said. Don't forget to execute

(push (cons "application" "json") drakma:*text-content-types*)

or whatever the content-type Facebook uses or drakma will return data as byte arrays which IIRC no JSON library knows what to do with it.

And my JSON parser library of choice is ST-JSON because it allows you to choose whether you want JS objects decoded as plists or alists.

like image 6
naryl Avatar answered Oct 13 '22 01:10

naryl