fukamachi / ningle

Super micro framework for Common Lisp
http://8arrow.org/ningle/
273 stars 25 forks source link

How to access *request* and *response* #11

Closed tgallant closed 9 years ago

tgallant commented 9 years ago

Hi I'm just starting out with your library. Thanks for all the hard work!

the documentation says

ningle provides two special variables named *request* and *response*. They will be bound to an instance Clack.Request and Clack.Response for each request.

can you provide an example of how to access these variables? I am trying to set the Content-Type to json

Thanks for the help

fukamachi commented 9 years ago

Sorry, the README was old. The latest ningle uses Clack v2 APIs and *request* and *response* are Lack.Request and Lack.Response.

You can set Content-Type header like this:

(setf (lack.response:headers *response*)
      (append (lack.response:headers *response*)
              (list :content-type "application/json")))
tgallant commented 9 years ago

this solves my issue. thanks!