Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this valid JSON?

{"something":"1","mode":"true","number":"1234"}

Because I'm getting a 406 on expecting JSON.

It's being generated via Jersey, which is told that a method @Produces JSON. It's being received by a Dojo xhrGet which has JSON set as its handleAs.

EDIT - To clarify, I'm not interested in the code where I evaluate or anything like that. The question was very simple - is it valid JSON?

like image 416
mtrc Avatar asked Jun 03 '09 14:06

mtrc


1 Answers

It is, but you've got both the boolean (mode) and numeric (number) elements as strings. Shouldn't it be:

{"something":"1","mode":true,"number":1234}
like image 138
Daniel Roseman Avatar answered Sep 21 '22 12:09

Daniel Roseman