JSON encode/decode MIME type adapter
Decodes JSON
# File lib/http/mime_type/json.rb, line 16 def decode(str) ::JSON.load str end
Encodes object to JSON
# File lib/http/mime_type/json.rb, line 10 def encode(obj) return obj.to_json if obj.respond_to?(:to_json) ::JSON.dump obj end