Class HttpFetchDsl
DSL extension that wires an HTTP-GET fetcher into a route step. Reads
{"url":"..."} from exchange.In.Body, fetches the URL with the
host / max-bytes / timeout guards configured in
, and writes the response body (UTF-8 text)
to exchange.Out.Body.
Built on directly — does not depend on
redb.Route.Http. Reuses one shared client across all callers.
// Canonical usage on a tool route:
From("direct:fetch-weather")
.AsLlmTool("get_weather")
.Description("Fetches the latest weather for a URL.")
.Input("""{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}""")
.Then()
.HttpFetch(new HttpFetchOptions { HostAllowlist = ["api.weather.gov"] });
// Or as a plain enrichment step in any pipeline:
From("amqp:queue:urls").HttpFetch(opts).To("amqp:queue:fetched");
public static class HttpFetchDsl
Inheritance
Methods
HttpFetch(IRouteDefinition, HttpFetchOptions)
Adds an HTTP-GET fetcher step that reads {"url":"..."} from the body.
public static IRouteDefinition HttpFetch(this IRouteDefinition self, HttpFetchOptions options)