![]() To complete the partnership, we also need a front-end, the client-side app that runs in the browser. ![]() The API allows any compatible software to communicate with WordPress, acting as the headless back-end of a combined client-server system. We can also use this endpoint to tell the CMS to create a new blog by sending an HTTP POST request with information such as the title and body text. If the request includes a post ID, it returns the contents of the specified post. When software sends a GET request to a WordPress site’s “posts” endpoint, it returns a list of posts and related information. Endpoints look just like the web addresses we use every day to visit websites, and they accept various types of request: GET requests to retrieve information, POST requests to submit information, and so on.įor example, WordPress has a “posts” endpoint that looks like this: WordPress has a REST API, a type of web-based API that allows the software to talk to it over the internet using HTTP web addresses called endpoints. When an application needs to ask for information or tell other software what to do, it communicates via an API. That’s the API’s role, which gives this approach to app development yet another name: API-driven development.Īn API is an Application Programming Interface, a standardized way for two pieces of software to talk to each other. How Does A Headless CMS Work?Ī client-side web app and a server-side content management system need a way to talk to each other. ![]() WordPress’s head, its PHP-based front-end interface, is bypassed in a somewhat gruesome metaphor, leaving the body (the CMS itself) on the server, controlled remotely by an external app. More accurately, a JavaScript application running in the browser creates the interface with content retrieved from WordPress. As you might have guessed from the name, the app’s interface is created and managed in the client-usually a browser, and not on the server. Headless WordPress is a different way of building web apps, sometimes called decoupled or client-side development. That’s why WordPress and web apps that work in the same way are called server-side apps. That document is then sent to your browser. When you load a page on a WordPress site, the server runs code that builds an HTML document. But first, let’s talk about how a traditional WordPress site works and how headless WordPress is different. We’re going to take a closer look at what headless WordPress is, how to use a headless content management system, and why you’d want to. Many developers, including WordPress creator Matt Mullenweg, see headless as the future of web app development. Headless WordPress is a new and increasingly popular way to build web apps that combine WordPress’s peerless content management with the power and flexibility of JavaScript front-end interfaces.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |