如何在带有引号的httpie中发送POST请求?

时间:2018-10-31 19:14:53

标签: json windows batch-file httpie

我在Windows Shell中使用httpie。我的命令如下所示:

http --form -v POST "http://192.168.1.1/set/time" category=Time settings={"timezone":"Universal","ntp":{"enable":"no"},"time":"11:19:53","date":"2018-10-31"}

但是,json值的传输不带引号:

{timezone:Universal,ntp:{enable:no},time:11:19:53,date:2018-10-31}

如何用引号传递?喜欢:

{"timezone":"Universal","ntp":{"enable":"no"},"time":"11:19:53","date":"2018-10-31"}

1 个答案:

答案 0 :(得分:0)

",需要转义:

http [...] settings={^"timezone^":^"Universal^"^,^"ntp^":{^"enable^":^"no^"}^,^"time^":^"11:19:53^"^,^"date^":^"2018-10-31^"}