fablo.http-client> (http/get "http://www.gram.pl/upl/katalog/w3/200906241203093791.jpg" :headers {"If-Modified-Since" "Wed, 24 Jun 2009 19:03:08 GMT"})
{:code 304, :reason "Not Modified", :content nil, :entity nil, :client #<DefaultHttpClient org.apache.http.impl.client.DefaultHttpClient@4990d0d2>, :response #<BasicHttpResponse org.apache.http.message.BasicHttpResponse@4833aa7b>, :headers (["Last-Modified" "Wed, 24 Jun 2009 19:03:08 GMT"] ["Accept-Ranges" "bytes"] ["ETag" ""0fe2969fef4c91:1493""] ["Server" "Microsoft-IIS/6.0"] ["X-Powered-By" "ASP.NET"] ["Date" "Fri, 04 Mar 2011 12:28:10 GMT"])}
So far, so good. But:
(http/get "http://www.gram.pl/upl/katalog/w3/200906241203093791.jpg" :headers {"If-Modified-Since" "Wed, 24 Jun 2009 19:03:08 GMT"} :as :string)
No message.
[Thrown class java.lang.NullPointerException]
Restarts:
0: [QUIT] Quit to the SLIME top level
Backtrace:
0: com.twinql.clojure.http$fn__10408.invoke(http.clj:207)
1: clojure.lang.MultiFn.invoke(MultiFn.java:171)
2: com.twinql.clojure.http$handle_http.invoke(http.clj:399)
3: com.twinql.clojure.http$get.doInvoke(http.clj:515)
I would have expected an empty string or nil in the :body of the response, not an exception.
So far, so good. But:
I would have expected an empty string or nil in the :body of the response, not an exception.