wordpress rest api就像没有数据一样发送

zor*_*con 5 api wordpress curl

我正在尝试用wordpress rest api创建一个帖子.随着卷发和邮递员,我得到以下回应.

{"code":"empty_content","message":"Content, title, and excerpt are empty.","data":{"status":400}}
Run Code Online (Sandbox Code Playgroud)

我的curl命令是

curl -X POST --user admin:secret http://mysite.local/wp-json/wp/v2/posts/ -d '{"post_title":"My New Title","Content":"the stuff","excerpt":"something"}'
Run Code Online (Sandbox Code Playgroud)

我知道我必须遗漏一些基本的东西.它的行为就像没有任何帖子数据到达它.有任何想法吗?

rao*_*oof 7

我有同样的问题,并通过添加以下选项解决它

-H "Content-Type: application/json"