You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at a lot of other libs in designing #264 I feel encoding an object assigned to the body property as querystring by default is quite possibly leading to the incorrect use of Got. More so when offering users some shortcut for common requests like other libs do, via the current json option. I'd suggest we do one of the following:
Create a ‘shortcut’ property for JSON and URL-encoded bodies. They would function as a flag. Automatically setting the Content-Type and stringifying if the body is assigned an object. With neither set, assigning an object to the body property would not be accepted. Same as node’s request.end() .
Drop the default URL-encoding and only accept a string, buffer, or a readableStream as the body.
The text was updated successfully, but these errors were encountered:
Looking at a lot of other libs in designing #264 I feel encoding an object assigned to the body property as querystring by default is quite possibly leading to the incorrect use of Got. More so when offering users some shortcut for common requests like other libs do, via the current
json
option. I'd suggest we do one of the following:Create a ‘shortcut’ property for JSON and URL-encoded bodies. They would function as a flag. Automatically setting the Content-Type and stringifying if the body is assigned an object. With neither set, assigning an object to the body property would not be accepted. Same as node’s
request.end()
.Drop the default URL-encoding and only accept a string, buffer, or a readableStream as the body.
The text was updated successfully, but these errors were encountered: