Member Junction
    Preparing search index...
    • Sends a POST request. Shorthand for HttpRequest with Method: 'POST'.

      A plain object or array body is JSON-encoded and given a JSON Content-Type. Pass a URLSearchParams for form encoding or a FormData for multipart, and fetch sets the correct Content-Type (including the multipart boundary) itself.

      Type Parameters

      • T = unknown

        the expected shape of the parsed response body.

      Parameters

      • url: string

        absolute URL, or a path when config.BaseURL is supplied.

      • Optionalbody: unknown

        the request body.

      • Optionalconfig: Omit<HttpRequestConfig, "Url" | "Method" | "Body">

        optional per-request settings.

      Returns Promise<HttpResponse<T>>

      the HttpResponse.

      on a non-2xx status, timeout, cancellation, or transport failure.

      await HttpPost('https://api.example.com/items', { name: 'Widget' });               // JSON
      await HttpPost(tokenUrl, new URLSearchParams({ grant_type: 'refresh_token' })); // form