diff --git a/src/request.ts b/src/request.ts index a9937cf..1783eb3 100644 --- a/src/request.ts +++ b/src/request.ts @@ -31,7 +31,11 @@ export function post( body?: Record, headers?: Record, ): Promise { - return httpRequest(service, "POST", path, undefined, body, headers); + const postHeaders = { + ...headers, + ["Content-Type"]: "application/json" + }; + return httpRequest(service, "POST", path, undefined, body, postHeaders); } export function patch( @@ -40,7 +44,11 @@ export function patch( body?: Record, headers?: Record, ): Promise { - return httpRequest(service, "PATCH", path, undefined, body, headers); + const patchHeaders = { + ...headers, + ["Content-Type"]: "application/json" + }; + return httpRequest(service, "PATCH", path, undefined, body, patchHeaders); } export function httpDelete(