Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Create a PHP REST API - Write a RESTful API from Scratch Using Plain, Object-Oriented PHP and MySQL

Dave Hollingworth via YouTube

Overview

Google, IBM & Meta Certificates – 40% Off
One Coursera Plus subscription covers most Professional Certificates on Coursera.
Unlock All Certificates
This course demonstrates how to build a complete RESTful API from scratch with plain object-oriented PHP and MySQL. It covers routing, JSON requests and responses, database operations, validation, error handling, and relevant HTTP status codes.

Syllabus

Introduction
API client
Front controller
RESTful endpoints
URL rewriting
HTTPie usage
Routing
404 response
Collection and resource URLs
Controller class
Class autoloading
Process the request
Collection requests
JSON Content-type
Create the database
Connect to the DB
Exception handling
Table gateway class
List all records
Encode JSON values
Insert a record
Get request data
201 response
Error handling
Data validation
422 response
405 response
Resource requests
Get a resource
404 response
Update a resource
Conditional validation
Delete a resource
Summary

Taught by

Dave Hollingworth

Reviews

Start your review of Create a PHP REST API - Write a RESTful API from Scratch Using Plain, Object-Oriented PHP and MySQL

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.