lewis
lewis

Reputation: 141

How to process html form data with kemal and crystal

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:)

Upvotes: 1

Views: 251

Answers (1)

Johannes Müller
Johannes Müller

Reputation: 5661

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

Upvotes: 2

Related Questions