pig/tool/web_fetch

Built-in web_fetch tool for simple HTTP GET requests.

Returns the HTTP status and response body as JSON. Intended as a ready-made tool that library users can register with pig.with_tool(web_fetch.tool()).

Values

pub fn tool() -> tool.Tool

Create a web_fetch tool.

The tool performs a GET request to the given URL and returns:

{"status": 200, "body": "<response body>"}

Returns a ToolError for invalid URLs, network failures, or non-2xx responses.

Search Document