You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should persist the product data on the server by using a REST api.
Endpoints that we would want:
get all products (GET)
create new product (POST)
Example of a rest endpoint call: http://localhost:8888/index.php?rest_route=/store/v1/products
For now we can use get_option and update_option to persist the data.
We should persist the product data on the server by using a REST api.
Endpoints that we would want:
Example of a rest endpoint call:
http://localhost:8888/index.php?rest_route=/store/v1/products
For now we can use
get_option
andupdate_option
to persist the data.Here is some documentation for creating a new REST route: https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints
We should follow the controller pattern as described here:
https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/#the-controller-pattern
These endpoints can be public. Something like Postman would be helpful to test the API endpoints.
The text was updated successfully, but these errors were encountered: