[query.rb] if format is declared as json, encode it as such in the reque...

...st body.

[query_spec.rb] just a spec to make sure that the body deserializes into the same thing as the original payload.

supposed to fix issue #249