[dancer-users] Returning JSON Data

WK wanradt at gmail.com
Mon Sep 14 23:05:11 BST 2015


2015-09-15 0:18 GMT+03:00 Kadir Beyazlı <kadirbeyazli at gmail.com>:

> content-type is text/html at both cases (with and without serializer),
> not application/json when i curl url.

It is very strange. If you use my example, save it as script and run
it, you got content type "text/html"?

> But it works
> And when I use serializer, other routes fail because other routes
> don't return json data.

You need to run 2 applications: one for html and other for serialized
data (JSON). Sawyer X wrote wonderful article about it in last advent
calendar:

http://advent.perldancer.org/2014/11

It is pretty easy and I assure you, it gives right content types too ;)

Wbr,
-- 
Kõike hääd,

Gunnar


More information about the dancer-users mailing list