My application provides a JSON API, and on post requests it includes JSON data in the request body. Is there some convenient way to access them in Roda, but already parsed? In Sinatra, Rails and Grape `params` would automatically merge the request body parameters to itself (parsed as either JSON or form-urlencoded), so you'd already have everything set up.
--
You received this message because you are subscribed to the Google Groups "Roda" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-roda+...@googlegroups.com.
To post to this group, send email to ruby...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-roda.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-roda/e8d07c66-28ec-4ea0-ad20-6f656557149f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Roda" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ruby-roda/5gRDIMqsfMc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ruby-roda+...@googlegroups.com.
To post to this group, send email to ruby...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-roda.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-roda/E31E5A0B-82D3-4976-A840-34137DE8AA55%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-roda/CAJ8a-RPSWHCCLswW1%3D9UgR_0xjt33mX-HhyWOwmZDbyRNbw7gA%40mail.gmail.com.
My application provides a JSON API, and on post requests it includes JSON data in the request body. Is there some convenient way to access them in Roda, but already parsed? In Sinatra, Rails and Grape `params` would automatically merge the request body parameters to itself (parsed as either JSON or form-urlencoded), so you'd already have everything set up.
--
You received this message because you are subscribed to a topic in the Google Groups "Roda" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ruby-roda/5gRDIMqsfMc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ruby-roda+...@googlegroups.com.
To post to this group, send email to ruby...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-roda.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-roda/5319c839-6aa8-4a95-aeb4-bbc095fc5be0%40googlegroups.com.
I'm wondering what is the best way to do expose this. It would be ideal if the method was named `params`, but then it would clash with the "indifferent_params" plugin. On the other hand, I feel like rack-parser's `env["rack.request.form_hash"]` would not be ideal to write. Also, I don't like in that rack-parser named the request body JSON "form_hash", becuase it doesn't come from a form (forms are url encoded), and even if it could, it doesn't have to (it can also come from an AJAX call).What do you think about merging that data into `Roda::RodaRequest#params`? This way plugins like "indifferent_params" would automatically work correctly.
--
You received this message because you are subscribed to a topic in the Google Groups "Roda" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ruby-roda/5gRDIMqsfMc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ruby-roda+...@googlegroups.com.
To post to this group, send email to ruby...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-roda.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-roda/e98a2aef-36a4-4ccd-855d-d0f2401360a6%40googlegroups.com.
Awesome, thank you, Jeremy :)
--
You received this message because you are subscribed to a topic in the Google Groups "Roda" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ruby-roda/5gRDIMqsfMc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ruby-roda+...@googlegroups.com.
To post to this group, send email to ruby...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-roda.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-roda/5d0a0485-0a60-4676-9a8a-a88a8c523852%40googlegroups.com.