ga-wdi-boston / api-token-auth

Other
4 stars 154 forks source link

Add explicit parse of form-data and JSON #3

Open gaand opened 8 years ago

gaand commented 8 years ago
> Rack::Utils.parse_nested_query('credentials[email]=abc@123.com&credentials[password]=abc123')
=> {"credentials"=>{"email"=>"abc@123.com", "password"=>"abc123"}}

> ActiveSupport::JSON.decode '{"credentials": {"email":"abc@123.com","password":"abc123"}}'
=> {"credentials"=>{"email"=>"abc@123.com", "password"=>"abc123"}}
gaand commented 8 years ago

This is to help make the two strings parse to the same result more clear.