mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Use keywords in POST/PUT examples
Using strings doesn't work for the POST/PUT examples here, changing them to keywords fixes this
This commit is contained in:
parent
1386d177df
commit
5d3e938574
@ -155,8 +155,8 @@ Now, your handlers may utilize query parameters:
|
|||||||
```clojure
|
```clojure
|
||||||
(defroutes myapp
|
(defroutes myapp
|
||||||
(GET "/posts" req
|
(GET "/posts" req
|
||||||
(let [title (get (:params req) "title")
|
(let [title (get (:params req) :title)
|
||||||
author (get (:params req) "author")]
|
author (get (:params req) :author)]
|
||||||
(str "Title: " title ", Author: " author))))
|
(str "Title: " title ", Author: " author))))
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -165,8 +165,8 @@ Or, for POST and PUT requests, form parameters as well
|
|||||||
```clojure
|
```clojure
|
||||||
(defroutes myapp
|
(defroutes myapp
|
||||||
(POST "/posts" req
|
(POST "/posts" req
|
||||||
(let [title (get (:params req) "title")
|
(let [title (get (:params req) :title)
|
||||||
author (get (:params req) "author")]
|
author (get (:params req) :author)]
|
||||||
(str "Title: " title ", Author: " author))))
|
(str "Title: " title ", Author: " author))))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user