Skip to main content

Interceptors

14
  • accept-header

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

  • basic-auth

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

  • construct-uri

    Request: construct uri from map

  • 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.

  • form-params

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

  • multipart

    Adds appropriate body and header if making a multipart request.

  • oauth-token

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

  • query-params

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

  • request-method

    Request: normalize :method option

  • throw-on-exceptional-status-code

    Response: throw on exceptional status codes

  • uri-with-query

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