我不确定这是否可行,但我正在尝试卷曲帖子,但是以json为参数,如下:
curl -X POST 'https://myserver/action?params={"field1":"something","whatever":10,"description":"body","id":"random","__oh__":{"session":"12345678jhgfdrtyui"}}'
然而,我不断收到一些错误curl: (3) [globbing] nested braces not supported at pos
X
我该怎么做?
答案 0 :(得分:13)
卷曲错误是由于大括号{}和方括号[]是特殊的卷曲字符。使用-g选项关闭globbing,你应该没问题。
答案 1 :(得分:5)
有两种方法可以解决这个问题。
例如:
curl -X POST -H "Content-Type: application/json" \
--data '{"field1":"something","whatever":10,"description":"body","id":"random","__oh__":{"session":"12345678jhgfdrtyui"}}' \
https://example.com/action