Skip to content

request

request(url, options?): Effect<Response, RequestError>

Sends an HTTP or HTTPS request and downloads the whole response. Any status counts as a response; check ok, or use json to require a 2xx. Stopping the script or interrupting the effect cancels the request.

string

Options = {}

Effect<Response, RequestError>

import * as Http from "mira/http";
export default function* () {
yield* Http.request("https://discord.com/api/webhooks/...", {
method: "POST",
json: { content: "Finished farming." },
});
}