Skip to main content

babashka.http-client.interceptors

A

  • accept-header

    Request: adds `:accept` header. Only supported value is `:json`.

B

  • basic-auth

    Request: adds `:authorization` header based on `:basic-auth` (a map of `:user` and `:pass`) in request.

C

D

  • decode-body

    Response: based on the value of `:as` in request, decodes as `:string`, `:stream` or `:bytes`. Defaults to `:string`.

  • decompress-body

    Response: decompresses body based on "content-encoding" header. Valid values: `gzip` and `deflate`.

  • default-interceptors

    Default interceptor chain. Interceptors are called in order for request and in reverse order for response.

F

  • form-params

    Request: encodes `:form-params` map and adds `:body`.

M

  • multipart

    Adds appropriate body and header if making a multipart request.

O

  • oauth-token

    Request: adds `:authorization` header based on `:oauth-token` (a string token) in request.

Q

  • query-params

    Request: encodes `:query-params` map and appends to `:uri`.

R

T

U

  • uri-with-query

    We can't use the URI constructor because it encodes all arguments for us. See https://stackoverflow.com/a/77971448/626...