RazorpayEx.HttpClient behaviour (razorpay_ex v0.1.3)

Copy Markdown View Source

HTTP client behaviour for making HTTP requests.

Summary

Types

body()

@type body() :: String.t()

headers()

@type headers() :: [{String.t(), String.t()}]

method()

@type method() :: :get | :post | :put | :patch | :delete

options()

@type options() :: keyword()

response()

@type response() ::
  {:ok, %{status_code: integer(), body: String.t(), headers: list()}}
  | {:error, %{reason: any()}}

url()

@type url() :: String.t()

Callbacks

request(method, url, body, headers, options)

@callback request(method(), url(), body(), headers(), options()) :: response()