Skip to content

Commit

Permalink
Merge pull request #9 from mdiin/master
Browse files Browse the repository at this point in the history
Add support for PUT method to ajax-lite (@mdiin)
  • Loading branch information
ptaoussanis committed Mar 19, 2015
2 parents 8485cf4 + e9fa3c5 commit e24b9c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/taoensso/encore.cljx
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,8 @@
(when-not (str/blank? s) s)))]
(case method
:get [(if ?pstr (str uri "?" ?pstr) uri) nil]
:post [uri ?pstr])))
:post [uri ?pstr]
:put [uri ?pstr])))

#+cljs
(defn ajax-lite
Expand Down Expand Up @@ -1777,7 +1778,7 @@
(if-let [xhr (get-pooled-xhr!)]
(try
(let [timeout-ms (or (:timeout opts) timeout-ms) ; Deprecated opt
method* (case method :get "GET" :post "POST")
method* (case method :get "GET" :post "POST" :put "PUT")
params (map-keys name params)
headers (merge {"X-Requested-With" "XMLHTTPRequest"}
(map-keys name headers))
Expand Down

0 comments on commit e24b9c4

Please sign in to comment.