如何使用 kemal 和 crystal 处理 html 表单数据

How to process html form data with kemal and crystal

我想以 html 形式获取用户输入并使用数据填充数据库 table。 Sinatra returns 散列中的表单数据,参数。我可以用 Kemal 和 Crystal 做这个吗?

请注意,我正在学习 Crystal,所以这可能还不可能。

预先感谢您的所有回答。与此同时,我还在挖掘:)

在 Crystal 中,一个 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