0

I am trying to send a HTTP POST via CURL on the command line. I am doing something wrong. Could someone advise me on what's wrong with my command? I am doing the following:

curl -X POST -H "Content-Type:application/json" https://www.url-here.com -d {JSON OBJECT HERE}
4

1 回答 1

0

如果你添加 -v 你会得到一个详细的错误信息,可以帮助调试。

根据手册,您应该将选项放在 url 之前。

这是我目前用于测试的 curl 调用,效果很好:

curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{}' http://example.com
于 2012-09-26T19:00:23.960 回答