Skip to content

fix: omit JSON bodies on GET requests - #301

Draft
Kayvan-Zahiri wants to merge 1 commit into
resend:mainfrom
Kayvan-Zahiri:codex/omit-json-body-on-get-requests
Draft

Kayvan-Zahiri wants to merge 1 commit into
resend:mainfrom
Kayvan-Zahiri:codex/omit-json-body-on-get-requests

Conversation

@Kayvan-Zahiri

@Kayvan-Zahiri Kayvan-Zahiri commented Oct 19, 2026 •

Copy link
Copy Markdown

Read-only SDK methods currently construct requests with params={}; both request implementations forward that as json={}. Consequently, Requests and HTTPX encode a JSON body and Content-Type on GET requests such as Emails.get() and Emails.list(), including paginated reads whose parameters are already in the URL.

Pass no JSON body for GET, preserving existing JSON serialization for writes. This aligns read requests with the API specification and other SDKs and avoids unnecessary GET payloads. This report does not claim a production Resend request currently fails because of the body.

Validation:

  • Eight public API wire-encoding cases inspect actual Requests PreparedRequest and HTTPX Request objects. Six GET cases fail before; two POST controls pass. All eight pass afterward, preserving pagination, auth headers, and POST JSON.
  • Full pytest suite with coverage/doctests: 859 passed, 10 warnings; 98% coverage. No network calls or emails were sent by tests; Requests transport/HTTPX MockTransport return controlled responses.
  • Full source Flake8, changed-source mypy, changed import sorting, new-test Black formatting, package wheel/sdist build, and git diff --check pass.

References:


Summary by cubic

Stops GET requests from sending a JSON body or Content-Type header, aligning read calls like Emails.get() and Emails.list() with the API specification and other SDKs. POST writes keep their existing JSON serialization.

  • GET requests previously forwarded params={} as json={}, so Requests and HTTPX encoded an empty JSON payload on every read.
  • Adds sync and async tests verifying GET bodies are empty while POST payloads remain intact.

Written for commit 0f4e10c. Summary will update on new commits.

View guided diff

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant