Skip to content
Browse files

Documentation for h.a.c/content-type and h.a.c/location.

  • Loading branch information...
1 parent 45f1e7b commit 76d0a3835fb375214713cf240198695c5fa852a7 @neotyk neotyk committed
Showing with 18 additions and 0 deletions.
  1. +18 −0 docs.org
View
18 docs.org
@@ -618,6 +618,24 @@
#+END_SRC
Again, like in case of status, body might not have been delivered
yet after this returns.
+*** Reading content-type
+ [[http://neotyk.github.com/http.async.client/doc/http.async.client.html#var-content-type][*http.async.client/content-type*]] returns value of *Content-Type*
+ header.
+ #+BEGIN_SRC clojure
+ (with-open [client (http/create-client)] ; Create client
+ (let [resp (http/GET client url)
+ content-type (http/content-type resp)]
+ (println "Content-Type of response:" content-type)))
+ #+END_SRC
+*** Reading location
+ [[http://neotyk.github.com/http.async.client/doc/http.async.client.html#var-location][*http.async.client/location*]] will return redirect target if
+ response is redirect.
+ #+BEGIN_SRC clojure
+ (with-open [client (http/create-client)] ; Create client
+ (let [resp (http/GET client url)
+ loc (http/location resp)]
+ (println "Location of redirect:" loc)))
+ #+END_SRC
*** Reading cookies
[[http://neotyk.github.com/http.async.client/doc/http.async.client.html#var-cookies][*http.async.client/cookies*]] returns seq of maps representing
cookies.

0 comments on commit 76d0a38

Please sign in to comment.
Something went wrong with that request. Please try again.