Klaviyo.HTTP.Response (klaviyo v3.0.0)

HTTP response returned by an adapter.

This response module differs from Klaviyo.HTTP.Response in that it does not decode the body. The purpose of this struct is to provide a simple data structure that doesn't require any additional processing of the response. This simplifies adapter creation since the adapter is only concerned with mapping the raw data it receives to this struct.

Link to this section Summary

Functions

Returns the value for the requested header.

Link to this section Types

@type t() :: %Klaviyo.HTTP.Response{
  body: String.t(),
  headers: Klaviyo.HTTP.headers_t(),
  status_code: Klaviyo.HTTP.status_code_t()
}

Link to this section Functions

Link to this function

get_header(response, header)

@spec get_header(t(), String.t()) :: String.t()

Returns the value for the requested header.

If the header does not exist nil is returned.