bat icon indicating copy to clipboard operation
bat copied to clipboard

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

Open leeola opened this issue 9 years ago • 1 comments

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]}

leeola avatar Dec 09 '16 18:12 leeola

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

radiospiel avatar Jan 07 '21 18:01 radiospiel