What problem does it solve?
Making outgoing HTTP calls from MoonBit Golem agents requires navigating WASI HTTP resource types whose MoonBit API differs significantly from TypeScript and Rust naming, and incorrect usage of constructors, encodings, or resource drop ordering causes compile errors or runtime traps.
Core Features & Use Cases
- Correct API Reference: Provides the exact MoonBit constructors and methods for Fields, OutgoingRequest, RequestOptions, Method, and Scheme, including common wrong-call pitfalls.
- Complete Request Patterns: Includes working GET, POST with JSON body, header handling, timeout configuration, error handling, and large-body streaming read loops.
- Retry and Durability Guidance: Explains status-code-keyed retry policies and atomic blocks for retrying non-2xx responses within Golem's durable execution model.
- Use Case: A MoonBit Golem agent needs to call an external REST API, parse the JSON response, and automatically retry on 5xx errors while keeping the call durably persisted in Golem's oplog.
Quick Start
Ask the AI to write a MoonBit Golem agent function that makes an authenticated POST request with a JSON body to an external API and reads the full response.