Skip to content

Http

Namespace Mc.Scripting · Kind class (static)

public static class Http

HTTP(S) for plugins. In the plugin worker the requests are performed by the server: its HTTP client resolves each name, refuses loopback, private, link-local and metadata addresses, limits request and response sizes and the rate, and enforces the timeouts (see docs/agents/http-egress.md, scripting.http.* in Ramjet.toml). In an in-process host (development only) requests go out directly. Use Http.Client, or new HttpClient(Http.Handler) for your own timeouts and headers. Do not dispose either: they are shared by every plugin.

Member Description
static HttpClient Client { get; } A shared client over Http.Handler.
static HttpMessageHandler Handler { get; } The message handler behind every request.
public static HttpClient Client { get; }

A shared client over Http.Handler. Set the time limit per request with a CancellationToken; the server applies its own total timeout as well. Do not dispose it.

public static HttpMessageHandler Handler { get; }

The message handler behind every request. Share it; do not dispose it.