UNPKG

typerinth

Version:

A TypeScript library for interacting with the Modrinth API.

22 lines (21 loc) 580 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UrlEncodedRequestBody = void 0; const RequestBody_1 = require("./RequestBody"); /** * URL-encoded form request body */ class UrlEncodedRequestBody extends RequestBody_1.RequestBody { data; constructor(data) { super(); this.data = data; } getContentType() { return 'application/x-www-form-urlencoded'; } getFormattedBody() { return new URLSearchParams(this.data).toString(); } } exports.UrlEncodedRequestBody = UrlEncodedRequestBody;