Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in case of 304 response and :as :string request #6

Open
jwr opened this issue Mar 4, 2011 · 0 comments
Open

Comments

@jwr
Copy link

jwr commented Mar 4, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant