diff --git a/lib/request.ts b/lib/request.ts index 86c377b..b26efd0 100644 --- a/lib/request.ts +++ b/lib/request.ts @@ -54,7 +54,7 @@ export class OctonoRequest extends Request { E extends keyof Endpoints, P extends OctonoRequestInit = E extends keyof Endpoints ? Endpoints[E]["parameters"] & OctonoRequestInit - : OctonoRequestInit + : OctonoRequestInit, >(endpoint: E, params?: P): OctonoRequest { const baseURL = params?.baseURL ? params.baseURL : GITHUB_URL; @@ -77,6 +77,10 @@ export class OctonoRequest extends Request { }, }; + if (method !== Method.GET) { + init.body = JSON.stringify(params || {}); + } + return new OctonoRequest(url.toString(), init); } }