Skip to content

Fix: Body quotes not escaped #12

@cuamckuu

Description

@cuamckuu

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\"}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions