fetch
fetch copied to clipboard
Fix: Body quotes not escaped
Hi, thanks for the app, it's usefull for converting curl API examples to JS code.
Also here is a problem
With input:
curl -X POST 'URL' -H 'Content-Type: application/json' --data '{"name": "Felix", "color": "black"}'
Output is:
fetch("https://URL", {
body: "{"name": "Felix", "color": "black"}",
headers: {
"Content-Type": "application/json"
},
method: "POST"
})
Take look at body, probably it should be something like: body: "{\"name\": \"Felix\", \"color\": \"black\"}"
@cuamckuu thank you for the clear issue, will look into it !