Building RESTful Web Services with PHP 7

Learn how to build RESTful API and web services in PHP 7
Preview in Mapt

Building RESTful Web Services with PHP 7

Haafiz Waheed-ud-din Ahmad

Learn how to build RESTful API and web services in PHP 7
Mapt Subscription
FREE
$29.99/m after trial
eBook
$10.00
RRP $35.99
Save 72%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$10.00
$44.99
$29.99 p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Building RESTful Web Services with PHP 7 Book Cover
Building RESTful Web Services with PHP 7
$ 35.99
$ 10.00
Building RESTful Web services with Go Book Cover
Building RESTful Web services with Go
$ 31.99
$ 10.00
Buy 2 for $20.00
Save $47.98
Add to Cart

Book Details

ISBN 139781787127746
Paperback244 pages

Book Description

REST is the most wide spread and effective standard to develop APIs for internet services. With the way PHP and its eco-system has modernized the way code is written by simplifying various operations, it is useful to develop RESTful APIs with PHP 7 and modern tools.

This book explains in detail how to create your own RESTful API in PHP 7 that can be consumed by other users in your organization.

Starting with a brief introduction to the fundamentals of REST architecture and the new features in PHP 7, you will learn to implement basic RESTful API endpoints using vanilla PHP. The book explains how to identify flaws in security and design and teach you how to tackle them. You will learn about composer, Lumen framework and how to make your RESTful API cleaner, secure and efficient. The book emphasizes on automated tests, teaches about different testing types and give a brief introduction to microservices which is the natural way forward.

After reading this book, you will have a clear understanding of the REST architecture and you can build a web service from scratch.

Table of Contents

Chapter 1: RESTful Web Services, Introduction and Motivation
Web services
REST architecture
RESTful web services
Why RESTful web services?
Nature of HTTP methods
HTTP response
Case study - RESTful web service endpoints for a blog
More resources
Summary
Chapter 2: PHP7, To Code It Better
Scalar type declaration
Return type declaration
Null coalescing operator
Spaceship operator
Group use declarations
Generator-related features
Anonymous classes
Closure::call()
Errors and exceptions
PHP7.1
More resources
Summary
Chapter 3: Creating RESTful Endpoints
Creating a REST API for a blog in PHP
Visible flaws
Summary
Chapter 4: Reviewing Design Flaws and Security Threats
Finding problems in the current code
Common security threats in RESTful web services
Available reusable code
Summary
Chapter 5: Load and Resolve with Composer, an Evolutionary
Introduction to Composer
Installation
Usage of Composer
Summary
Chapter 6: Illuminating RESTful Web Services with Lumen
Introducing Lumen
Installing Lumen
Setting up the database
Writing RESTful web service endpoints
Controller Implementation
What we are missing?
Summary
Chapter 7: Improving RESTful Web Services
Dingo, simplifying RESTful API development
Authentication and middleware
Transformers
Encryption
Summary
Chapter 8: API Testing – Guards on the Gates
The need for automated tests
Types of testing
What type of testing will we do?
Testing frameworks
Summary
Chapter 9: Microservices
Introducing Microservices
Motivation towards microservices
How it is different from SOA
Team structure
Challenges of micro-services
Implementation
Summary

What You Will Learn

  • Understand the REST API architecture and its benefits
  • Write RESTful API web services in PHP 7
  • Address security-elated issues in a REST API
  • Leverage the importance of automated testing and write tests for API endpoints
  • Identify security flaws in our current API endpoints and tackle them effectively
  • Observe the working of Lumen microframeworks and write RESTful web services in it

Authors

Table of Contents

Chapter 1: RESTful Web Services, Introduction and Motivation
Web services
REST architecture
RESTful web services
Why RESTful web services?
Nature of HTTP methods
HTTP response
Case study - RESTful web service endpoints for a blog
More resources
Summary
Chapter 2: PHP7, To Code It Better
Scalar type declaration
Return type declaration
Null coalescing operator
Spaceship operator
Group use declarations
Generator-related features
Anonymous classes
Closure::call()
Errors and exceptions
PHP7.1
More resources
Summary
Chapter 3: Creating RESTful Endpoints
Creating a REST API for a blog in PHP
Visible flaws
Summary
Chapter 4: Reviewing Design Flaws and Security Threats
Finding problems in the current code
Common security threats in RESTful web services
Available reusable code
Summary
Chapter 5: Load and Resolve with Composer, an Evolutionary
Introduction to Composer
Installation
Usage of Composer
Summary
Chapter 6: Illuminating RESTful Web Services with Lumen
Introducing Lumen
Installing Lumen
Setting up the database
Writing RESTful web service endpoints
Controller Implementation
What we are missing?
Summary
Chapter 7: Improving RESTful Web Services
Dingo, simplifying RESTful API development
Authentication and middleware
Transformers
Encryption
Summary
Chapter 8: API Testing – Guards on the Gates
The need for automated tests
Types of testing
What type of testing will we do?
Testing frameworks
Summary
Chapter 9: Microservices
Introducing Microservices
Motivation towards microservices
How it is different from SOA
Team structure
Challenges of micro-services
Implementation
Summary

Book Details

ISBN 139781787127746
Paperback244 pages
Read More

Read More Reviews

Recommended for You

WordPress Complete - Sixth Edition Book Cover
WordPress Complete - Sixth Edition
$ 35.99
$ 10.00
WordPress Plugin Development Cookbook - Second Edition Book Cover
WordPress Plugin Development Cookbook - Second Edition
$ 31.99
$ 10.00
Vue.js 2 and Bootstrap 4 Web Development Book Cover
Vue.js 2 and Bootstrap 4 Web Development
$ 35.99
$ 10.00
JavaScript by Example Book Cover
JavaScript by Example
$ 27.99
$ 10.00
Comprehensive Ruby Programming Book Cover
Comprehensive Ruby Programming
$ 31.99
$ 10.00
Building RESTful Web services with Go Book Cover
Building RESTful Web services with Go
$ 31.99
$ 10.00