Missing form parameters in Compojure POST request

前端 未结 4 1734
北荒
北荒 2021-01-01 18:30

I\'m having problems getting the form parameters in the following Compojure example:

(ns hello-world
  (:use compojure.core, ring.adapter.jetty)
  (:require          


        
4条回答
  •  没有蜡笔的小新
    2021-01-01 18:56

    You can just give a list of parameters; compojure will automatically get them out of POST/GET params accordingly. If you need to do more complex stuff you can, but I've never looked into how. For example, here's a snippet from the code for 4clojure:

    (POST "/problems/submit" [title tags description code]
      (create-problem title tags description code))
    

提交回复
热议问题