I’m getting a 401 while calling the wp-json endpoint via ajax

Question

I’m trying to use an AJAX call from a front end page to pull a list "Staff" (custom post type). I can get the data in the browser via wp-json/wp/v2/staff but I get a 401 when I try to pull the data via AJAX. I’m assuming I need to authenticate somehow but can’t work out how to to do it.

Thanks in advance.

0
Codescribler 1 month 2021-10-27T10:51:18-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse