Hi,

When I send a POST request with JQuery or with a plan HTML form I see

'CONTENT_TYPE' => 'application/x-www-form-urlencoded; charset=UTF-8',

and the data looks like this:

'body' => 'foo=23&bar=19',


If I understand it correctly then this is what Dancer turns into the values
accessible via param()

When I use Angular to send a POST request to the Dancer back-end, by
default it send

'CONTENT_TYPE' => 'application/json;charset=UTF-8',

and the data looks like this:

'body' => '{"foo":23,"bar":19}',

and Dancer2 does not parse this.


Shouldn't Dancer2 look at the content type of the POST request and handle
the data accordingly?
Or is that the job of PSGI? Do I need to tell something to Dancer2 or to
PSGI to do this?

regards
   Gabor
_______________________________________________
dancer-users mailing list
[email protected]
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

Reply via email to