I am trying to create a post with the wordpress rest api. With curl and postman I get the following response.
{"code":"empty_content","message":"Content, title, and excerpt are empty.","data":{"status":400}}
My curl command is
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"}'
I know I must be missing something basic here. It acts like no post data is reaching it. Any ideas?
I had the same problem and solved it by add the following option
-H "Content-Type: application/json"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With