Liking cljdoc? Tell your friends :D
All platforms.

milia.api.http


parse-httpclj/s

(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

  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>}
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>}
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close