curl-to-postman icon indicating copy to clipboard operation
curl-to-postman copied to clipboard

can not parse `Content-Type: application/json;charset=UTF-8` to body json mode

Open vikyd opened this issue 3 years ago • 0 comments

curl :

curl 'http://localhost:9999/myApi' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  --data-raw '{"name":"d4"}' \
  --compressed

result:

{
    "result": true,
    "output": [
        {
            "type": "request",
            "data": {
                "method": "POST",
                "name": "http://localhost:9999/myApi",
                "url": "http://localhost:9999/myApi",
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json;charset=UTF-8"
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\"name\":\"d4\"}"
                },
                "description": "Generated from a curl request: \ncurl 'http://localhost:9999/myApi'   -H 'Content-Type: application/json;charset=UTF-8'   --data-raw '{\\\"name\\\":\\\"d4\\\"}'   --compressed"
            }
        }
    ]
}

want (part) (missing the options):

"body": {
	"mode": "raw",
	"raw": "{\"name\":\"d4\"}",
	"options": {
		"raw": {
			"language": "json"
		}
	}
},

vikyd avatar Jun 21 '21 08:06 vikyd