joaotavora / snooze

Common Lisp RESTful web development
207 stars 22 forks source link

Backend payload with hunchentoot #13

Open JensNevens opened 5 years ago

JensNevens commented 5 years ago

For me, the function payload-as-string was not functioning properly, using Huchentoot as a backend. The curl request I send looks like this:

curl -H "Content-Type: application/json" -d '{"foo": "bar"}' http://localhost:9003/clevr-api/comprehend

The method backend-payload, which is called by payload-as-string, would read the raw post data from Hunchentoot as a byte array. I implemented a quick fix by replacing (funcall (read-from-string "hunchentoot:raw-post-data")) by (apply (read-from-string "hunchentoot:raw-post-data") '(:force-text t)). This is maybe not the best solution, but it works for my purposes.

joaotavora commented 5 years ago

Thanks for reporting this. Maybe an encoding error. I'll have a look.

JensNevens commented 5 years ago

Any news on this issue?

PS: I am using macOS 10.13 and LispWorks 7.1. Maybe this helps to solve the issue.

davd33 commented 4 years ago

20 I had the same issue, solved by the fixed proposed by @JensNevens, and so I'm submitting a PR to fix this here too.