mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-25 16:23:37 +03:00
Merge pull request #1120 from bobbywilson0/patch-1
Use keywords in POST/PUT examples
This commit is contained in:
commit
8dba840cfe
@ -155,8 +155,8 @@ Now, your handlers may utilize query parameters:
|
||||
```clojure
|
||||
(defroutes myapp
|
||||
(GET "/posts" req
|
||||
(let [title (get (:params req) "title")
|
||||
author (get (:params req) "author")]
|
||||
(let [title (get (:params req) :title)
|
||||
author (get (:params req) :author)]
|
||||
(str "Title: " title ", Author: " author))))
|
||||
```
|
||||
|
||||
@ -165,8 +165,8 @@ Or, for POST and PUT requests, form parameters as well
|
||||
```clojure
|
||||
(defroutes myapp
|
||||
(POST "/posts" req
|
||||
(let [title (get (:params req) "title")
|
||||
author (get (:params req) "author")]
|
||||
(let [title (get (:params req) :title)
|
||||
author (get (:params req) :author)]
|
||||
(str "Title: " title ", Author: " author))))
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user