Api error message

Hi,
I am trying to use this below:

curl -X GET --user username:password -i http://yourdomain.com/wp-json/wp/v2/posts?status=draft

But I’ve got an 400 error message (HTTP/1.1 400 Bad request). What could that be? I’ve already tried other so far but this one doesn’t work…

Thanks in advance

Are you learning about the WP Rest api from some resource?

When I review the REST API handbook, it looks like the command is close, but slightly different:

curl --user "USERNAME:PASSWORD" https://HOSTNAME/wp-json/wp/v2/users?context=edit

Also, according to the docs, you want to ensure that you have an application password set that you can use.

I’ve got this error message but I don’t know where that comes from…

I am trying to post this on my local site. But the change expected is not displayed. There may bee something to do with the server operator. Does someone know how to resolve this?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.