Skip to content

fix: send JSON request bodies as JSON in AsyncTwilioHttpClient (#994) - #995

Open
shrutiburman wants to merge 1 commit into
mainfrom
xinghaohuang91fix/async-json-body
Open

shrutiburman wants to merge 1 commit into
mainfrom
xinghaohuang91fix/async-json-body

Conversation

@shrutiburman

Copy link
Copy Markdown
Contributor

AsyncTwilioHttpClient passed every body to aiohttp as data, which form-encodes a dict. Endpoints whose Content-Type is application/json (Conversations v2, Memory v1, Knowledge v2, ...) then got a form body and returned 400 when called with the async client. The sync client already picks json= for these content types (#737); this applies the same rule to the async client.

Fixes

A short description of what this PR does.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

AsyncTwilioHttpClient passed every body to aiohttp as `data`, which
form-encodes a dict. Endpoints whose Content-Type is application/json
(Conversations v2, Memory v1, Knowledge v2, ...) then got a form body
and returned 400 when called with the async client. The sync client
already picks `json=` for these content types (#737); this applies the
same rule to the async client.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

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.

2 participants