Skip to content

Difference in (-d) parsing between curlie and curl #11

@bored-engineer

Description

@bored-engineer

It looks like curlie gets a little confused when passing -d:

$ curlie https://httpbin.org/post -d 'foo=bar'
...
{
    "args": {

    },
    "data": "foo=bar&{\"foo\":\"bar\"}",
    "files": {

    },
    "form": {

    },
    "headers": {
        "Accept": "application/json, */*",
        "Content-Length": "21",
        "Content-Type": "application/json",
        "Host": "httpbin.org",
        "User-Agent": "curl/7.64.1"
    },
    "json": null,
    ...
}
$  curl https://httpbin.org/post -d 'foo=bar'
{
  "args": {},
  "data": "",
  "files": {},
  "form": {
    "foo": "bar"
  },
  "headers": {
    "Accept": "*/*",
    "Content-Length": "7",
    "Content-Type": "application/x-www-form-urlencoded",
    "Host": "httpbin.org",
    "User-Agent": "curl/7.64.1"
  },
  "json": null,
  ...
}

I'm assuming this is a bug where it's doing both JSON parsing and passing data?

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