fukamachi / ningle

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

Response is broken #23

Open mfiano opened 7 years ago

mfiano commented 7 years ago

Directly from the documentation in a controller:

(setf (lack.response:response-status *response*) 201)
201 fell through ETYPECASE expression.
Wanted one of (NULL PATHNAME LIST (VECTOR (UNSIGNED-BYTE 8))).
   [Condition of type SB-KERNEL:CASE-FAILURE]
(setf (lack.response:response-headers *response*)
      (append (lack.response:response-headers *response*)
              (list :content-type "application/json")))
The value
  "application/json"
is not of type
  LIST
   [Condition of type TYPE-ERROR]
jackcarrozzo commented 7 years ago

Show us your entire route - is that the last line in your func? Try something like this:

(setf (ningle:route *app* "/thing/" :method :PUT)
      #'(lambda (params)
          (setf (lack.response:response-headers ningle:*response*)
                (append (lack.response:response-headers ningle:*response*)
                        (list :content-type "application/json")))
          (setf (lack.response:response-status ningle:*response*) 201)

          "worked"))