method LegacyUserAgent.post
Private
LegacyUserAgent.post(
url: string,
kind: "form" | "json",
data: Record<string, string> | Record<string, unknown>
): Promise<{ result: LegacyHttpResult; }>

kind mirrors Mojo::UserAgent's own ->post($url => form => {...}) / ->post($url => json => {...}) calling convention — form URL-encodes data as application/x-www-form-urlencoded (string values only, matching real HTML form semantics); json sends it as a application/json body (data may be any JSON-serializable value — verified against the one real json-kind call site in the corpus, which passes a nested object with an array value, not just flat strings).

Parameters

url: string
kind: "form" | "json"
data: Record<string, string> | Record<string, unknown>

Return Type

Promise<{ result: LegacyHttpResult; }>

Usage

import { type LegacyUserAgent } from "plugins/legacy-globals.d.ts";