Skip to content

fix: JSON-serialize async HTTP bodies for application/json - #964

Open
Steve0x2a wants to merge 1 commit into
twilio:mainfrom
Steve0x2a:fix/async-json-body
Open

fix: JSON-serialize async HTTP bodies for application/json#964
Steve0x2a wants to merge 1 commit into
twilio:mainfrom
Steve0x2a:fix/async-json-body

Conversation

@Steve0x2a

Copy link
Copy Markdown

AsyncTwilioHttpClient.request always passed the request body to aiohttp as data=, even when Content-Type was application/json or application/scim+json. aiohttp then form-encoded the dict, so JSON-body v2 endpoints (for example messaging.v2.channels_senders(...).update_async(...)) returned 400. The sync TwilioHttpClient already JSON-serializes those content types via json=.

This change mirrors that content-type branch in the async client.

Credits @adcore-dev for the report, the named files, and the suggested json= branch.

Fixes #932

Signed-off-by: Yi Zhan <stevesough@gmail.com>
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.

AsyncTwilioHttpClient does not JSON-serialize request bodies for application/json endpoints (sync client does) → 400 on JSON-body v2 endpoints

1 participant