YoVDO

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

Offered By: Dave Hollingworth via YouTube

Tags

PHP Courses MySQL Courses Object-oriented programming Courses Data Validation Courses

Course Description

Overview

Develop a complete RESTful API from scratch using plain, object-oriented PHP and MySQL in this comprehensive 44-minute tutorial. Learn to create RESTful URLs, manage database records through API operations, organize PHP code efficiently, implement controllers and table gateways, return appropriate HTTP status codes, and handle JSON encoding/decoding for requests and responses. Explore best practices for API development, including data validation, error handling, and exception management. Follow along as the instructor guides you through setting up a front controller, implementing URL rewriting, connecting to a database, and creating endpoints for listing, showing, creating, updating, and deleting records. Gain practical insights into using tools like cURL, Postman, and HTTPie for API testing and interaction.

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

Related Courses

Introduction à la programmation orientée objet (en Java)
École Polytechnique Fédérale de Lausanne via Coursera
C++ For C Programmers, Part A
University of California, Santa Cruz via Coursera
Introduction to Programming for Musicians and Digital Artists
California Institute of the Arts via Coursera
Beginning Game Programming with C#
University of Colorado System via Coursera
Paradigms of Computer Programming
Université catholique de Louvain via edX