bat
bat copied to clipboard
foo:={"bar":"baz"} doesn't work as expected?
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]}
pls be aware that {0:0} is not valid JSON. The key must be a string