Basic-Auth icon indicating copy to clipboard operation
Basic-Auth copied to clipboard

Basic Auth not working for curl

Open axaeo opened this issue 10 years ago • 0 comments

I'm trying to retrieve custom fields from a post on our website - we have REST API configured, and I understand that to retrieve custom fields with REST, we have to access the page in edit mode. However, the following curl request:

curl -u "myuserid:mypassword" http://www.mywebsite.com/wp-json/posts/67?context=edit

Consistently returns the following, even though I have the Basic Auth plugin installed:

[{"code":"json_cannot_edit","message":"Sorry, you cannot edit this post"}]

The request works fine if I don't include ?context=edit. I'm not sure how to proceed in debugging this. (For further context, we're also using Advanced Custom Fields - I'm not sure if this affects our ability to use this plugin or not.

axaeo avatar Oct 05 '15 16:10 axaeo