Closed brandonkal closed 5 years ago
This is a configurable option. Can't you change that when passing in your data?
Yes. It works perfectly fine when setting the option. It just seemed like a nice option when the input data is detected as an object.
I don't think you can presume that passing in an object means they want the type to be JSON.
Folks will sometimes pass in objects that need to be stringified before sending to an API endpoint, for example.
When an object is passed, the content type should be transparently set to JSON yet it is: "application/x-www-form-urlencoded" This causes objects that contain other objects to be converted to the "[object Object]" string.