Hi,
i would like some feedback (idiomatic code? interface usable?) on:
http://groups.google.com/group/clojure/web/http-client.clj
(http-client/url-do "
https://gmail.com" "GET" { :read-timeout
5000 :set-header { "User-Agent" "Clojure-HttpClient/
0.1 } :connect-timeout
1000 :http-proxy "
http://proxy.org:8080" } ))
returns a map:
{:return-message "Found", :return-code 302, :header {nil [HTTP/1.1 302
Found], "Server" [GFE/1.3], "Content-Type" [text/html; charset=UTF-8],
"Date" [Thu, 10 Jul 2008 19:31:52 GMT], "Location" [http://
www.google.com], "Content-Length" [218]}, :body [B@bed1e7}
body is a byte array, so you can cast the bytes to utf-8 or a png
depending on the Content-Type.
I had more problems with the java.* libs (lacks of experience i guess)
than with clojure. Clojure rocks!
I stress tested the client somewhat, seems to be stable. Exception
handling is still lacking though....
Cheers,
Dirk