(parse-http method
url
&
{:keys [accept-header callback filename http-options
suppress-4xx-exceptions? raw-response? as-map? no-cache?
must-revalidate? auth-token]})Send and parse an HTTP response as JSON.
Additional arguments modify beavior of parse-http:
In both: raw-response?, filename, http-options.
In CLJ: suppress-4xx-exceptions?, as-map?.
In CLJS: accept-header callback, no-cache?.
When a request fails for one of the following reasons, an exception is thrown
with a map containing a :reason key, and an optional :detail key
Send and parse an HTTP response as JSON.
Additional arguments modify beavior of parse-http:
In both: `raw-response?`, `filename`, `http-options`.
In CLJ: `suppress-4xx-exceptions?`, `as-map?`.
In CLJS: `accept-header` `callback`, `no-cache?`.
When a request fails for one of the following reasons, an exception is thrown
with a map containing a `:reason` key, and an optional `:detail` key
1. No response: {:reason :no-http-response}
2. 4xx response: {:reason :http-client-error
:detail {:status-code <status-code>
:response <parsed-json-from-server>}
3. 5xx response: {:reason :http-server-error
:detail {:response <raw-response>
:status-code <status-code>}cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |