Testing Wordpress REST API with POSTMAN #1
Wordpress REST API
Wordpress REST API provides an interface for application to interact with WP website by sending and receiving data as JSON (JavaScript Object Notation).
The Wordpress REST (Representational State Transfer) API provide REST endpoints (URLs) representing the posts, pages and other data-types. Application can send and receive JSON data on these URLs to create, update or delete content (CRUD operations).
More information here ---> REST API Handbook
Testing Wordpress Endpoints with POSTMAN
Postman is popular API client which let developers to create, test, share and document APIs. HTTP requests and responses can be created and stored for testing purposes.
Let's try to receive some JSON from Wordpress REST API which is running on localhost port 8000
And response is error 404 (not found)
To fix that error we need to edit Permalinks setting in wp-admin panel from Plain to Post name
Let's try again... and sucess. We received JSON data as a response, with all information about our website.
Now we have access to other endpoints like /posts or /users
Comments
Post a Comment