• I am working on a test project. I am using ReactJS for frontend and wordpress for backend like Headless CMS. I am making API calls to fetch all wordpress posts through ReactJS and it is working fine. The only thing i need is to hide the JSON whenever anyone try to browse the URL in any browser. It should not show my personal site data in the form of JSON.

    I don’t wanna disable the rest API because it will stop answering my API calls of ReactJS. In simple I just want to HIDE the JSON response. Can someone tell me how this is achievable ?

    Thanks

    • This topic was modified 2 years, 7 months ago by Jan Dembowski.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    You can use a filter like “rest_post_dispatch” to alter responses, but I’m not sure how you’d securely distinguish your app’s request from any other request. User agent maybe? That’s easily spoofed though. Requiring an application password for any response is maybe a good way. I know how to send them where needed, but not sure how one verifies it in the API. I’m sure there’s a way.

    Thread Starter MA-2016

    (@ma123456)

    @bcworkz Requiring application password for any response is good option.Let see if someone else say if it is doable or not.

    I have the same question, was wondering if you have found a reliable solution to this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can i hide Rest API response from URL visitors ?’ is closed to new replies.