I'm having quite a time getting http-agent from contrib to work. I'm
using Clojure 1.0.0 and the clojure-1.0-compat branch of clojure-
contrib.

1. I can't get the body of any request:

   user=> (use 'clojure.contrib.http.agent)
   nil
   user=> (let [agent (http-agent "http://google.com";)] (response-body-
str agent))
   nil
   user=> (let [agent (http-agent "http://google.com";)] (response-body-
bytes agent))
   nil

   Other methods work fine:

   user=> (let [agent (http-agent "http://google.com";)] (response-
headers-seq agent))
   ([nil "HTTP/1.1 200 OK"] ["Date" "Sun, 13 Sep 2009 06:22:41 GMT"]
["Expires" "-1"] ["Cache-Control" "private, max-age=0"] ["Content-
Type" "text/html; charset=ISO-8859-1"] ["Set-Cookie"
"PREF=ID=a9a302346909fad6:TM=1252822961:LM=1252822961:S=PBdT_Q14Du2nzPMg;
expires=Tue, 13-Sep-2011 06:22:41 GMT; path=/; domain=.google.com"]
["Server" "gws"] ["Transfer-Encoding" "chunked"])
   user=> (let [agent (http-agent "http://google.com";)] (response-
message agent))
   "OK"
   user=> (let [agent (http-agent "http://google.com";)] (response-
status agent))
   200

2. If I call any of the response-* methods more than once, I get
exceptions:

   user=> (let [agent (http-agent "http://google.com";)] `(~(response-
status agent) ~(response-message agent)))
   java.lang.Exception: Agent has errors (NO_SOURCE_FILE:0)
   user=>

What gives? Am I doing something wrong here, or is http-agent really
that broken?

- Ian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to