1

I want to get user input in an html form and use the data to populate a database table. Sinatra returns the form data in a hash, params. Can I do this with Kemal and Crystal?

Please note, I am in the process of learning Crystal, so this may not even be possible yet.

Thanks in advance for all answers. Meanwhile, I'm still digging:)

1
  • I found this while looking through the Crystal docs. I can use env.params.body and assign to a variable name and use name["key'] to access the form data. Still looking.
    – lewis
    Nov 20, 2017 at 23:29

1 Answer 1

2

In Crystal, an HTTP::Handler receives an HTTP::Server::Context argument. Through this context, you can access the request and read the form data. The same also applies to Kemal, there is also a section in the guid: HTTP Parameters

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.