![]() In WP API’s case, authentication for on site actions (plugins or themes installed to the site) are handled by cookies. In addition, all POST, PUT and DELETE WP API actions require authentication. For example, getting post revisions, getting users and getting post meta data require authentication. Other GET requests do require authentication though. In WP API, for example, certain GET requests like getting posts and getting media don’t require authentication. It’s important to know that some HTTP requests don’t require authentication (anyone can make requests and the corresponding responses). For example, you can use the WP API to create a post, retrieve a post, update a post or delete a post associated with your WordPress website. With the WP API, you can perform any of the four CRUD actions against any of your WordPress site’s resources listed above. In the case of the most recent version of the WP API (version 2), the resources include the following 9 WordPress objects: The WP REST API allows you to “access your WordPress site’s data (resources) through an easy-to-use HTTP REST API”. There are four primary actions associated with any HTTP request (commonly referred to as CRUD):Ī resource is a data object that can be accessed via a HTTP request. In a HTTP request, you need to define the type of action that you want to perform against a resource. The server responds with an HTTP response. A client makes a HTTP request to a server and 2. The client (JavaScript code) would receive a response from the Facebook server indicating that the user’s status was successfully published.ġ. As an example, in order to publish a status to a user’s Facebook timeline, a HTTP request targeting that action on behalf of that user would be sent from our JavaScript code to Facebook’s API (ie. This protocol allows information to be shared between a client (cell phone, tablet, laptop, desktop, etc.) and a web accessible server in a request-response protocol. HTTP requests are often the way that you interact with a RESTful API (HTTP requests are also the primary way that data is transmitted across the Internet). You can look up what these constraints are here. An API can be considered RESTful if its design/architecture subscribes to a specific set of constraints. REST means Representational State Transfer. An API typically includes a specific set of instructions called documentation to make it easy for any developer to work with it. ![]() For example, Facebook’s API gives developers the ability to get all of the friends associated with a certain user. An API is a programmatic way to interact with an application’s data. ![]() The acronym API stands for Application Programming Interface. Before we discuss the WP REST API, it’s important to understand some terminology and background information. ![]()
0 Comments
Leave a Reply. |