usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
21.54k stars 1.01k forks source link

fix: invalid json body mistakenly quoted #2449

Open GregoireBellon opened 2 weeks ago

GregoireBellon commented 2 weeks ago

Description

This pull request addresses the issue https://github.com/usebruno/bruno/issues/2043.

It is also related to this one https://github.com/axios/axios/issues/4034

In my opinion, Bruno shouldn't patch a faulty JSON string, since it restrains its range of use, notably when working with poorly designed APIs.

Moreover, other API clients (Postman, insomnia) don't have this behavior, so it could prevent one from adopting Postman.

The fix consists in adding a transformRequest to the Axios instance that prevents the default behavior if the content type is "application/json" and the body is a string.

hotbinz commented 6 days ago

yes,you are right,please merge this request as soon as possible