From d45eb9a7acbcbc382f6d6a19a88e7085b841f054 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 15:48:26 +0000 Subject: [PATCH 1/2] fix(client): send content-type header for requests with an omitted optional body --- src/client.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 3a5e0b8..049563b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -785,11 +785,19 @@ export class PostGrid { return () => controller.abort(); } - private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): { + private buildBody({ options }: { options: FinalRequestOptions }): { bodyHeaders: HeadersLike; body: BodyInit | undefined; } { + const { body, headers: rawHeaders } = options; if (!body) { + // A resource method always passes a `body` key when its operation defines a + // request body, even if the caller omitted an optional body param. Keep the + // content-type for those, and only elide it for operations with no body at + // all (e.g. GET/DELETE). + if (body == null && 'body' in options) { + return this.#encoder({ body, headers: buildHeaders([rawHeaders]) }); + } return { bodyHeaders: undefined, body: undefined }; } const headers = buildHeaders([rawHeaders]); From 5d8a1a7c1b34237adb0dc583338f58a6ac20292d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 15:48:55 +0000 Subject: [PATCH 2/2] release: 0.7.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e7ca613..13708fa 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.7.0" + ".": "0.7.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b652ca..8f553c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.7.1 (2026-06-16) + +Full Changelog: [v0.7.0...v0.7.1](https://github.com/postgrid/postgrid-node/compare/v0.7.0...v0.7.1) + +### Bug Fixes + +* **client:** send content-type header for requests with an omitted optional body ([d45eb9a](https://github.com/postgrid/postgrid-node/commit/d45eb9a7acbcbc382f6d6a19a88e7085b841f054)) + ## 0.7.0 (2026-06-12) Full Changelog: [v0.6.1...v0.7.0](https://github.com/postgrid/postgrid-node/compare/v0.6.1...v0.7.0) diff --git a/package.json b/package.json index 027f083..76ff1fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postgrid-node", - "version": "0.7.0", + "version": "0.7.1", "description": "The official TypeScript library for the PostGrid API", "author": "PostGrid ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index d9da9f7..5e85c4b 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.7.0'; // x-release-please-version +export const VERSION = '0.7.1'; // x-release-please-version