0

is there a way to use Wordpress REST API if the site is protected with AuthType Basic using htpasswd?

  • Before anyone answers I think they may want to know why you need to do this. There are different and easier ways to manage and authenticate. Please be as descriptive with your question as possible. Welcome to the site! – Nathan Powell Jul 25 at 14:26
0

You have to supply basic auth headers like below :

curl -D- \
   -X GET \
   -H "Authorization: Basic xxxxyyyzzz" \
   -H "Content-Type: application/json" \
   "https://your-domain.com/rest/api/v1"

"xxxxyyyzzz" is the username:password base64 encoded

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.