FastestMCP.Resources.HTTP (fastest_mcp v0.1.2)

Copy Markdown View Source

Helper for serving HTTP-backed resources.

This is a thin wrapper around :httpc so resource handlers can fetch remote data without rebuilding the same transport glue repeatedly.

Summary

Functions

Builds an HTTP-backed resource helper.

Fetches the remote resource and returns a normalized result.

Types

t()

@type t() :: %FastestMCP.Resources.HTTP{
  body: iodata() | nil,
  headers: [{charlist(), charlist()}],
  method: atom(),
  mime_type: String.t() | nil,
  url: String.t()
}

Functions

new(url, opts \\ [])

Builds an HTTP-backed resource helper.

read(resource)

Fetches the remote resource and returns a normalized result.