Support » Developing with WordPress » How Can I Communicate with My WordPress Rest Api from Outside of WordPress.

  • tejasshetty12041


    i want to connnect to my wordpress data through the WP rest api from my other application, i’m making a post/get request to my wp rest api endpoint but i’m getting this error -> :"ab.html:14 OPTIONS https://*********/wp-json/wp/v2/posts 0 ()", is there some authorization/ authentication that i’m missing ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz


    Where did you see that error? Error log? Headers? JSON? I’ve not encountered an error like that before. It looks like you tried to make an OPTIONS request to the posts route. If you didn’t, could your app do so unknown to you? It’s a reasonable request, but I don’t believe such a request requires authentication.

    I’m puzzled why the error even lists the posts route if you were making a request to your endpoint. You didn’t try to add your endpoint to the posts route did you? You should have your own route, or if using an existing route, only add endpoints for request methods not already defined.

    What is the REST API request you’re making to it? The actual request API URL such as wp-json/wp/v2/posts...?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.