WP REST call works in postman but not on actual site
-
Hello all!
I am playing around with the WordPress REST Api and I encountered a problem I couldn’t solve so far:
I am trying to retrieve all comments for a specific post. The endpoint for that is /wp-json/wp/v2/comments?post=1234. When trying this API call in Postman it is working just fine. I put my credentials in as Basic Auth and I’ll get an array of comments as the response.
When I am using this exact same API call on my actual site (I am developing on my local machine, so localhost) I’ll get an empty array. It is a successful request returning a 200 status. When checking the headers the authorization is sent correctly.
I tried many different ways to make the API call: jQuery ajax, XMLHttpRequest, etc.. all variants returned an empty array while being a successful call.
What might be the problem here..?
The page I need help with: [log in to see the link]
- The topic ‘WP REST call works in postman but not on actual site’ is closed to new replies.