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

SymfonyCasts

RESTful APIs in the Real World Course 1

via SymfonyCasts

Overview

Making RESTful APIs is hard, really hard. There are a lot of concepts to know - resources, representations, HTTP methods, status codes, etc.

And putting this all to life in a sane way in PHP is no small task. In this course, we'll learn all the most fundamental concepts around REST and learn about the "rules" and the advantages and disadvantages of each. And we'll of course build a real API to show it all off. Topics include:

  • HTTP basics
  • Resources and Representations
  • Resource state, client state
  • GET, POST, PUT, PATCH, DELETE
  • Idemptotency and safe methods
  • Proper Status Codes, Location header and Content-Type
  • Testing your API
  • RFCs and where the "rules" come from
  • Advanced error and validation handling

If you want to know about Hypermedia, HATEOAS, Content-Type negotiation, pagination and more, these are not covered here, but are covered in Episode 2.

This tutorial uses Silex and we avoid talking about it as much as possible and instead focus on the core concepts of REST. Once you understand these, you can watch our Symfony REST series to learn how to leverage Symfony for your API.

Syllabus

  • The REST API Tutorial
  • HTTP Basics
  • REST: Resources and Representations
  • Transitions and Client State
  • Project Routing
  • POST: Creation, Location Header and 201
  • GET’ing Resources, and Content-Type
  • Updating the Location Header
  • GET /programmers: A collection of Programmers
  • Fixing the Content-Type on POST
  • Testing your API with PHPUnit
  • Behat for Testing
  • Handling Data in Tests
  • PUT: Editing Resources
  • Debugging Tests
  • PUT: Killing Duplicated Code
  • GET Representation != POST Representation
  • PUT Versus POST
  • Deleting Resources
  • PATCH: The Other Edit
  • Handling Errors
  • The application/problem+json Content-Type
  • Enforcing Consistency with ApiProblem
  • Error in Invalid JSON
  • ApiProblemException and Exception Handling
  • Handling 404 Errors
  • Exposing more Error Details
  • What’s Next

Taught by

Ryan Weaver and Leanna Pelham

Reviews

Start your review of RESTful APIs in the Real World Course 1

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.