Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response is broken #23

Open
mfiano opened this issue Feb 3, 2017 · 1 comment
Open

Response is broken #23

mfiano opened this issue Feb 3, 2017 · 1 comment

Comments

@mfiano
Copy link

mfiano commented Feb 3, 2017

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
Copy link
Contributor

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"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants