Building remote connections with REST API
WordPress REST API is gaining popularity over the old XML-RPC API and becoming a standard in site development. The API allows developers to connect WordPress sites with other sites as well as third-party applications. Modern sites are moving towards JS Framework-based frontends to optimize performance as well as to simplify the user experience. In such scenarios, developers can use WordPress as the backend for the core functionality and expose the data through the REST API to build frontends without using WordPress. The REST API could well be the future of development with WordPress.
The REST API was initially introduced in a external plugin for testing. Finally, it was included in WordPress core in WordPress 4.7, and now it fully supports REST API endpoints for all the major data models in WordPress.
Let's identify some of the common terms used in REST API operations:
- Route: This is a well-defined URL that can be mapped to an HTTP method
- Endpoint: The...