Groq.HTTPClient behaviour (Groq v0.1.0)

HTTP client behaviour.

Summary

Types

The body for an HTTP request or response.

The headers for an HTTP request or response.

The response for an HTTP request.

The response status for an HTTP request.

Callbacks

Make an HTTP POST request to the given url with the provided req_headers and req_body.

Types

@type body() :: binary()

The body for an HTTP request or response.

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

The headers for an HTTP request or response.

@type response() :: {:ok, status(), headers(), body()} | {:error, term()}

The response for an HTTP request.

@type status() :: 100..599

The response status for an HTTP request.

Callbacks

Link to this callback

post(url, req_headers, req_body)

@callback post(url :: String.t(), req_headers :: headers(), req_body :: body()) ::
  response()

Make an HTTP POST request to the given url with the provided req_headers and req_body.