Skip to content

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

@jwr

Description

@jwr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions