View Source AnyHttp.Client behaviour (Any HTTP v0.1.1)

Defines the behaviour for the HTTP adapters to implement.

Summary

Types

Represents the body of a request.

Represents the headers of a request.

Represents the options passed to the adapter.

Represents the response of a request.

Represents the result of a request. It can be either a success or an error.

Represents an URL.

Callbacks

Makes a DELETE request to the given URL.

Makes a DELETE request to the given URL.

Makes a GET request to the given URL.

Makes a GET request to the given URL.

Makes a HEAD request to the given URL.

Makes a HEAD request to the given URL.

Makes a PATCH request to the given URL.

Makes a PATCH request to the given URL.

Makes a POST request to the given URL.

Makes a POST request to the given URL.

Makes a PUT request to the given URL.

Makes a PUT request to the given URL.

Types

@type body() :: AnyHttp.Types.body()

Represents the body of a request.

@type headers() :: AnyHttp.Types.headers()

Represents the headers of a request.

@type opts() :: AnyHttp.Types.opts()

Represents the options passed to the adapter.

@type response() :: AnyHttp.Types.response()

Represents the response of a request.

@type result() :: AnyHttp.Types.result()

Represents the result of a request. It can be either a success or an error.

@type url() :: AnyHttp.Types.url()

Represents an URL.

Callbacks

Link to this callback

delete(url, headers, body)

View Source
@callback delete(url(), headers(), body()) :: result()

Makes a DELETE request to the given URL.

Link to this callback

delete(url, headers, body, opts)

View Source
@callback delete(url(), headers(), body(), opts()) :: result()

Makes a DELETE request to the given URL.

Same as delete/3 but with options.

@callback get(url(), headers(), body()) :: result()

Makes a GET request to the given URL.

Link to this callback

get(url, headers, body, opts)

View Source
@callback get(url(), headers(), body(), opts()) :: result()

Makes a GET request to the given URL.

Same as get/3 but with options.

@callback head(url(), headers()) :: result()

Makes a HEAD request to the given URL.

Link to this callback

head(url, headers, opts)

View Source
@callback head(url(), headers(), opts()) :: result()

Makes a HEAD request to the given URL.

Same as head/2 but with options.

Link to this callback

patch(url, headers, body)

View Source
@callback patch(url(), headers(), body()) :: result()

Makes a PATCH request to the given URL.

Link to this callback

patch(url, headers, body, opts)

View Source
@callback patch(url(), headers(), body(), opts()) :: result()

Makes a PATCH request to the given URL.

Same as patch/3 but with options.

Link to this callback

post(url, headers, body)

View Source
@callback post(url(), headers(), body()) :: result()

Makes a POST request to the given URL.

Link to this callback

post(url, headers, body, opts)

View Source
@callback post(url(), headers(), body(), opts()) :: result()

Makes a POST request to the given URL.

Same as post/3 but with options.

@callback put(url(), headers(), body()) :: result()

Makes a PUT request to the given URL.

Link to this callback

put(url, headers, body, opts)

View Source
@callback put(url(), headers(), body(), opts()) :: result()

Makes a PUT request to the given URL.

Same as put/3 but with options.