astaxie / bat

Go implement CLI, cURL-like tool for humans
Apache License 2.0
2.55k stars 220 forks source link

foo:={"bar":"baz"} doesn't work as expected? #53

Open leeola opened 7 years ago

leeola commented 7 years ago

The following example results in a string as the value, instead of raw json:

> bat POST :8000 name:='{0:0}'
POST / HTTP/1.1
Host: localhost:8000
Accept: application/json
Accept-Encoding: gzip, deflate
Content-Type: application/json
User-Agent: bat/0.1.0

{"name":"{0:0}"}

The same method with an array instead of an object results in an array, as expected:

> bat POST :8000 name:='[0,0]'
POST / HTTP/1.1
Host: localhost:8000
Accept: application/json
Accept-Encoding: gzip, deflate
Content-Type: application/json
User-Agent: bat/0.1.0

{"name":[0,0]}
radiospiel commented 3 years ago

pls be aware that {0:0} is not valid JSON. The key must be a string