summaryrefslogtreecommitdiffhomepage
path: root/compojure.html.markdown
diff options
context:
space:
mode:
authorven <vendethiel@hotmail.fr>2015-05-31 00:35:47 +0200
committerven <vendethiel@hotmail.fr>2015-05-31 00:35:47 +0200
commit8dba840cfe3404a3e718b3b57f6874d577360d38 (patch)
tree7543cb50c837b66c2877577a862b2b9b417c1ef7 /compojure.html.markdown
parent1386d177df87caeb2487cd8cf2430f5a261a8780 (diff)
parent5d3e938574b74704801dcb61043a8603ac087f73 (diff)
Merge pull request #1120 from bobbywilson0/patch-1
Use keywords in POST/PUT examples
Diffstat (limited to 'compojure.html.markdown')
-rw-r--r--compojure.html.markdown8
1 files changed, 4 insertions, 4 deletions
diff --git a/compojure.html.markdown b/compojure.html.markdown
index 36a8d123..32181e26 100644
--- a/compojure.html.markdown
+++ b/compojure.html.markdown
@@ -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))))
```