httpie / cli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
https://httpie.io
BSD 3-Clause "New" or "Revised" License
32.74k stars 3.68k forks source link

`http -v` should show escaped Unicode as-is #1474

Open wataash opened 1 year ago

wataash commented 1 year ago

In the two commands below, both shows the same JSON.

$ http -v httpbin.org/post a:='"あ"'
...
{
    "a": "あ"
}
...

$ echo '{"a": "あ"}' | http -v httpbin.org/post
...
{
    "a": "あ"
}
...

But actually they send different data:

image image

In the first command, I expect it to show \u3042, but it seems parse the escaped Unicode and show the parsed letter .

i.e. it should output:

$ http -v httpbin.org/post a:='"あ"'
...
{
    "a": "\u3042"
}
...

$ echo '{"a": "あ"}' | http -v httpbin.org/post
...
{
    "a": "あ"
}
...

See also https://github.com/httpie/httpie/issues/814.