Skip to content

Conversation

@ryota-iso
Copy link

Overview

When Content-Type: application/json is explicitly specified, automatically apply JSON.stringify to the object body to resolve the issue where [object Object] is sent.
For non-JSON Content-Types, existing behavior is preserved.

Background / Issue

issue: #76
In the current implementation, even when application/json is specified, an object body is not serialized and is instead sent as [object Object].

Key Changes

When the header includes "content-type": "application/json", JSON.stringify is applied.

Expected Behavior

For requests that specify application/json, payloads such as { "foo": "bar" } are correctly sent as a JSON string.

Copy link

@bujxke bujxke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I've been experiencing the same issue while explicitly trying to set content-type to application/json

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