dakrone / clj-http

An idiomatic clojure http client wrapping the apache client. Officially supported version.
http://clojars.org/clj-http
MIT License
1.78k stars 411 forks source link

How to handle 404 error when gettting response from URL #539

Closed RomitGandhi07 closed 4 years ago

RomitGandhi07 commented 4 years ago

(def a "https://en.wikipedia.org/api/rest_v1/page/summary/The_glass_bead_game") (client/get a)

I have tried this but it isn't handling 404 requests, is there any way to handle it?

dakrone commented 4 years ago

Yes, there are many ways to handle it, please see: https://github.com/dakrone/clj-http#exceptions