SlideShare a Scribd company logo
Simple Web Services with PHP
Date: 02/23/17
Presented by John Paul Ada
GAPLabs
John Paul Ada
- BA Psychology Graduate
- Desktop, Web, Mobile Developer
- Three years industry dev experience
- Dev Community Contributor
- Tech Evangelist
John Paul Ada
Software Engineer
Objectives
● Recognize a monolithic architecture and its problems
● Know what a web service is and its characteristics
● Know the differences between the two approaches
● Build a simple web service with PHP
By the end of this session, you should be able to:
Requirements
● Books Demo API code - https://github.com/johnpaulada/books-demo-api
● Books Demo Web code -
https://github.com/johnpaulada/books-demo-web
● PHP: http://192.168.254.102:8001/php-7.1.2-Win32-VC14-x86.zip
● MySQL:
http://192.168.254.102:8001/mysql-installer-community-5.7.17.0.msi
● XAMPP:
http://192.168.254.102:8001/xampp-win32-7.1.1-0-VC14-installer.exe
● Insomnia: http://192.168.254.102:8001/Insomnia+Setup+4.2.14.exe
● Git: http://192.168.254.102:8001/Git-2.11.1-32-bit.exe
You’ll need these tools: (SSID: CPE Laboratory; Password: CCSIT_OFFICE_1980)
Monolithic Architecture
The Bad and the Bad
Monolithic Architecture
What is a monolithic architecture?
It’s a software “structure” wherein all the parts of the system are interwoven and are not separate,
reusable parts.
Don’t use it.
It’s hard to manage these when they get huge with a lot of code and you don’t have much flexibility.
Monolithic Architecture Problems
● Tightly coupled; changing one part might change the others
● Slow; a whole page instead of just the data
● Opinionated; you’re not giving the users a choice on how to use your data
● Not flexible; you’re limited to using only a web page
Monolithic Architecture
Database
Server
Client
All in the
same
server/unit
Monolithic Architecture Code Snippet
<?php
$title = “Art of Seduction”;
$author = “Robert Greene”;
?>
<div>
<p>Title: <?php echo $title; ?></p>
<p>Author: <?php echo $author; ?></p>
</div>
Web Services
A more modern approach/solution
Web Services
What is a web service?
A web service is an application or a fraction of it which allows other applications to use it and is not
tightly coupled to another application.
Use this instead of monolithic architectures.
This approach eliminates most of the problems posed by monolithic architectures.
Web Service Characteristics
● Loosely coupled; changing the web service will not change the client
and vice versa
● Fast; loads just the data instead of a whole web page
● Unopinionated; you’re giving the users a choice on how to use your data
● Flexible; you’re not limited to using only a web page -- you can use a
desktop or mobile app
Web Services
Web Service
Desktop Web Mobile
REST APIs
Most common approach to Web Services
REST APIs
What does REST stand for?
REST stands for REpresentational State Transfer.
What is it really?
It’s just a fancy term for an approach to building web services that revolves around HTTP Methods and
endpoints.
What are APIs?
Application Programming Interfaces. They’re the services or the libraries that allow you to use a
particular service. Take for example, Facebook’s or Twitter’s APIs.
HTTP Response
HTTP/1.1 201 CREATED
Date: Wed, 22 Feb 2017 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Wed, 22 Feb 2017 12:28:53 GMT
Content-Length: 29
Content-Type: application/json
Connection: Closed
{“title”: “Art of Seduction”}
HTTP Request
POST /books HTTP/1.1
Host: localhost
Content-Type: application/json
{“title”: “Art of Seduction”}
HTTP Codes
● 2XX - Request success
● 3XX - Redirects
● 4XX - Client’s fault
● 5XX - Server’s fault
Common HTTP Codes
● 200 - OK
● 201 - Created
● 204 - No Content
● 301 - Moved Permanently
● 400 - Bad Request
● 401 - Unauthorized
● 403 - Forbidden
● 404 - Not Found
● 500 - Internal Server Error
REST Endpoints
Request to/from collection
/collection_name; e.g. /books
Request to/from a specific object
/collection_name/:id; e.g. /books/1
CRUD with REST
Read all books
GET /books
Read a book
GET /books/1
Create a book
POST /books
Update a book
PUT /books/1
Remove a book
DELETE /books/1
Ad

More Related Content

What's hot (20)

Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Marie Smith
 
Professional tools and workflows for theme development
Professional tools and workflows for theme developmentProfessional tools and workflows for theme development
Professional tools and workflows for theme development
Marius Cristea
 
Web assembly with PWA
Web assembly with PWA Web assembly with PWA
Web assembly with PWA
Shashank Sharma
 
Product Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsProduct Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical Skills
Sandeep Adwankar
 
Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
Isuru Madusanka
 
Rise of the responsive single page application
Rise of the responsive single page applicationRise of the responsive single page application
Rise of the responsive single page application
Oren Shatken
 
Rise and Fall of the Frontend Developer
Rise and Fall of the Frontend DeveloperRise and Fall of the Frontend Developer
Rise and Fall of the Frontend Developer
Rafael Casuso Romate
 
Client & server side scripting
Client & server side scriptingClient & server side scripting
Client & server side scripting
baabtra.com - No. 1 supplier of quality freshers
 
single page application
single page applicationsingle page application
single page application
Ravindra K
 
Client Side scripting and server side scripting
Client Side scripting and server side scriptingClient Side scripting and server side scripting
Client Side scripting and server side scripting
baabtra.com - No. 1 supplier of quality freshers
 
Lightning In The Clouds
Lightning In The CloudsLightning In The Clouds
Lightning In The Clouds
george.james
 
Server side scripting
Server side scriptingServer side scripting
Server side scripting
baabtra.com - No. 1 supplier of quality freshers
 
Seamless Migration
Seamless MigrationSeamless Migration
Seamless Migration
jasnow
 
The Full Stack Web Development
The Full Stack Web DevelopmentThe Full Stack Web Development
The Full Stack Web Development
Sam Dias
 
Progressive web applications
Progressive web applicationsProgressive web applications
Progressive web applications
Tom Martin
 
VFP & Ajax
VFP & AjaxVFP & Ajax
VFP & Ajax
Mike Feltman
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
KMS Technology
 
Php
PhpPhp
Php
Shubham Agrawal
 
Full stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFull stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choice
FDConf
 
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web components
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web componentsBoston, MA Developer Group 2/7/2019 - Introduction to lightning web components
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web components
BingWang77
 
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Marie Smith
 
Professional tools and workflows for theme development
Professional tools and workflows for theme developmentProfessional tools and workflows for theme development
Professional tools and workflows for theme development
Marius Cristea
 
Product Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsProduct Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical Skills
Sandeep Adwankar
 
Rise of the responsive single page application
Rise of the responsive single page applicationRise of the responsive single page application
Rise of the responsive single page application
Oren Shatken
 
Rise and Fall of the Frontend Developer
Rise and Fall of the Frontend DeveloperRise and Fall of the Frontend Developer
Rise and Fall of the Frontend Developer
Rafael Casuso Romate
 
single page application
single page applicationsingle page application
single page application
Ravindra K
 
Lightning In The Clouds
Lightning In The CloudsLightning In The Clouds
Lightning In The Clouds
george.james
 
Seamless Migration
Seamless MigrationSeamless Migration
Seamless Migration
jasnow
 
The Full Stack Web Development
The Full Stack Web DevelopmentThe Full Stack Web Development
The Full Stack Web Development
Sam Dias
 
Progressive web applications
Progressive web applicationsProgressive web applications
Progressive web applications
Tom Martin
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
KMS Technology
 
Full stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFull stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choice
FDConf
 
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web components
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web componentsBoston, MA Developer Group 2/7/2019 - Introduction to lightning web components
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web components
BingWang77
 

Viewers also liked (11)

Demystifying Object-Oriented Programming - Lone Star PHP
Demystifying Object-Oriented Programming - Lone Star PHPDemystifying Object-Oriented Programming - Lone Star PHP
Demystifying Object-Oriented Programming - Lone Star PHP
Alena Holligan
 
Object-Oriented Programming with PHP (part 1)
Object-Oriented Programming with PHP (part 1)Object-Oriented Programming with PHP (part 1)
Object-Oriented Programming with PHP (part 1)
Bozhidar Boshnakov
 
PHP Experience 2016 - ROA – Resource Oriented Architecture
PHP Experience 2016 - ROA – Resource Oriented ArchitecturePHP Experience 2016 - ROA – Resource Oriented Architecture
PHP Experience 2016 - ROA – Resource Oriented Architecture
iMasters
 
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016 Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Alexander Lisachenko
 
Walter Mischel - Related Studies
Walter Mischel - Related StudiesWalter Mischel - Related Studies
Walter Mischel - Related Studies
John Paul Ada
 
WebCamp 2016: PHP. Николай Паламарчук: PHP и микросервисы
WebCamp 2016: PHP. Николай Паламарчук: PHP и микросервисыWebCamp 2016: PHP. Николай Паламарчук: PHP и микросервисы
WebCamp 2016: PHP. Николай Паламарчук: PHP и микросервисы
WebCamp
 
Social Cognitive Learning Perspective
Social Cognitive Learning PerspectiveSocial Cognitive Learning Perspective
Social Cognitive Learning Perspective
Farah Ishaq
 
PHP with Service BUS (RabbitMQ/Redis/MongoDB) - IMasters PHP Experience 2016
PHP with Service BUS (RabbitMQ/Redis/MongoDB) - IMasters PHP Experience 2016PHP with Service BUS (RabbitMQ/Redis/MongoDB) - IMasters PHP Experience 2016
PHP with Service BUS (RabbitMQ/Redis/MongoDB) - IMasters PHP Experience 2016
Alexandre Brandão Lustosa
 
浅谈电商网站数据访问层(DAL)与 ORM 之适用性
浅谈电商网站数据访问层(DAL)与 ORM 之适用性浅谈电商网站数据访问层(DAL)与 ORM 之适用性
浅谈电商网站数据访问层(DAL)与 ORM 之适用性
Xuefeng Zhang
 
Process Oriented Architecture
Process Oriented ArchitectureProcess Oriented Architecture
Process Oriented Architecture
Alan McSweeney
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
Andrew Rota
 
Demystifying Object-Oriented Programming - Lone Star PHP
Demystifying Object-Oriented Programming - Lone Star PHPDemystifying Object-Oriented Programming - Lone Star PHP
Demystifying Object-Oriented Programming - Lone Star PHP
Alena Holligan
 
Object-Oriented Programming with PHP (part 1)
Object-Oriented Programming with PHP (part 1)Object-Oriented Programming with PHP (part 1)
Object-Oriented Programming with PHP (part 1)
Bozhidar Boshnakov
 
PHP Experience 2016 - ROA – Resource Oriented Architecture
PHP Experience 2016 - ROA – Resource Oriented ArchitecturePHP Experience 2016 - ROA – Resource Oriented Architecture
PHP Experience 2016 - ROA – Resource Oriented Architecture
iMasters
 
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016 Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Alexander Lisachenko
 
Walter Mischel - Related Studies
Walter Mischel - Related StudiesWalter Mischel - Related Studies
Walter Mischel - Related Studies
John Paul Ada
 
WebCamp 2016: PHP. Николай Паламарчук: PHP и микросервисы
WebCamp 2016: PHP. Николай Паламарчук: PHP и микросервисыWebCamp 2016: PHP. Николай Паламарчук: PHP и микросервисы
WebCamp 2016: PHP. Николай Паламарчук: PHP и микросервисы
WebCamp
 
Social Cognitive Learning Perspective
Social Cognitive Learning PerspectiveSocial Cognitive Learning Perspective
Social Cognitive Learning Perspective
Farah Ishaq
 
PHP with Service BUS (RabbitMQ/Redis/MongoDB) - IMasters PHP Experience 2016
PHP with Service BUS (RabbitMQ/Redis/MongoDB) - IMasters PHP Experience 2016PHP with Service BUS (RabbitMQ/Redis/MongoDB) - IMasters PHP Experience 2016
PHP with Service BUS (RabbitMQ/Redis/MongoDB) - IMasters PHP Experience 2016
Alexandre Brandão Lustosa
 
浅谈电商网站数据访问层(DAL)与 ORM 之适用性
浅谈电商网站数据访问层(DAL)与 ORM 之适用性浅谈电商网站数据访问层(DAL)与 ORM 之适用性
浅谈电商网站数据访问层(DAL)与 ORM 之适用性
Xuefeng Zhang
 
Process Oriented Architecture
Process Oriented ArchitectureProcess Oriented Architecture
Process Oriented Architecture
Alan McSweeney
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
Andrew Rota
 
Ad

Similar to Simple Web Services with PHP (20)

RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel Mardjan
Jexia
 
Food borne human diseases
Food borne human diseasesFood borne human diseases
Food borne human diseases
AmalMohammedNasserSa
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
LINAGORA
 
The PRPL Pattern
The PRPL PatternThe PRPL Pattern
The PRPL Pattern
Red Pill Now
 
The Decoupled CMS in Financial Services
The Decoupled CMS in Financial ServicesThe Decoupled CMS in Financial Services
The Decoupled CMS in Financial Services
Open Source Strategy Forum
 
Introduction to Web Frameworks
Introduction to Web FrameworksIntroduction to Web Frameworks
Introduction to Web Frameworks
Dr Sarika Jadhav
 
Node.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdfNode.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdf
Mindfire LLC
 
PWA basics for developers
PWA basics for developersPWA basics for developers
PWA basics for developers
Filip Rakowski
 
Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum Slides
Abhishek Gupta
 
Web Development Today
Web Development TodayWeb Development Today
Web Development Today
bretticus
 
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
PamRobert
 
Prog db-and-web-with-html-php-and-my sql
Prog db-and-web-with-html-php-and-my sqlProg db-and-web-with-html-php-and-my sql
Prog db-and-web-with-html-php-and-my sql
Antara Sharma
 
bca project for application and final project
bca project for application and final projectbca project for application and final project
bca project for application and final project
LetsDispolify
 
9 Best Tools to Leverage for Progressive Web App Development
9 Best Tools to Leverage for Progressive Web App Development9 Best Tools to Leverage for Progressive Web App Development
9 Best Tools to Leverage for Progressive Web App Development
codecraftcrew
 
Top 10 Best PWA Development Tools and Technologies to Use.pdf
Top 10 Best PWA Development Tools and Technologies to Use.pdfTop 10 Best PWA Development Tools and Technologies to Use.pdf
Top 10 Best PWA Development Tools and Technologies to Use.pdf
Groovy Web
 
PHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolPHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the fool
Alessandro Cinelli (cirpo)
 
Introduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App DevelopmentIntroduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App Development
Özcan Zafer AYAN
 
Would Mr. Spok choose Open Source
Would Mr. Spok choose Open SourceWould Mr. Spok choose Open Source
Would Mr. Spok choose Open Source
vlcinsky
 
Ignou BCA 5th semester mini project report.
Ignou BCA 5th semester mini project report.Ignou BCA 5th semester mini project report.
Ignou BCA 5th semester mini project report.
stevedark00
 
Full-Stack-Presentation-Slide(Longsaar_Francis).pptx
Full-Stack-Presentation-Slide(Longsaar_Francis).pptxFull-Stack-Presentation-Slide(Longsaar_Francis).pptx
Full-Stack-Presentation-Slide(Longsaar_Francis).pptx
longsaarmuknaan
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel Mardjan
Jexia
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
LINAGORA
 
Introduction to Web Frameworks
Introduction to Web FrameworksIntroduction to Web Frameworks
Introduction to Web Frameworks
Dr Sarika Jadhav
 
Node.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdfNode.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdf
Mindfire LLC
 
PWA basics for developers
PWA basics for developersPWA basics for developers
PWA basics for developers
Filip Rakowski
 
Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum Slides
Abhishek Gupta
 
Web Development Today
Web Development TodayWeb Development Today
Web Development Today
bretticus
 
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
PamRobert
 
Prog db-and-web-with-html-php-and-my sql
Prog db-and-web-with-html-php-and-my sqlProg db-and-web-with-html-php-and-my sql
Prog db-and-web-with-html-php-and-my sql
Antara Sharma
 
bca project for application and final project
bca project for application and final projectbca project for application and final project
bca project for application and final project
LetsDispolify
 
9 Best Tools to Leverage for Progressive Web App Development
9 Best Tools to Leverage for Progressive Web App Development9 Best Tools to Leverage for Progressive Web App Development
9 Best Tools to Leverage for Progressive Web App Development
codecraftcrew
 
Top 10 Best PWA Development Tools and Technologies to Use.pdf
Top 10 Best PWA Development Tools and Technologies to Use.pdfTop 10 Best PWA Development Tools and Technologies to Use.pdf
Top 10 Best PWA Development Tools and Technologies to Use.pdf
Groovy Web
 
PHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolPHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the fool
Alessandro Cinelli (cirpo)
 
Introduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App DevelopmentIntroduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App Development
Özcan Zafer AYAN
 
Would Mr. Spok choose Open Source
Would Mr. Spok choose Open SourceWould Mr. Spok choose Open Source
Would Mr. Spok choose Open Source
vlcinsky
 
Ignou BCA 5th semester mini project report.
Ignou BCA 5th semester mini project report.Ignou BCA 5th semester mini project report.
Ignou BCA 5th semester mini project report.
stevedark00
 
Full-Stack-Presentation-Slide(Longsaar_Francis).pptx
Full-Stack-Presentation-Slide(Longsaar_Francis).pptxFull-Stack-Presentation-Slide(Longsaar_Francis).pptx
Full-Stack-Presentation-Slide(Longsaar_Francis).pptx
longsaarmuknaan
 
Ad

More from John Paul Ada (8)

Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and Docker
John Paul Ada
 
Practical AI - Building a Recommendation System
Practical AI - Building a Recommendation SystemPractical AI - Building a Recommendation System
Practical AI - Building a Recommendation System
John Paul Ada
 
Internet of Things Building Blocks with Arduino and Node RED
Internet of Things Building Blocks with Arduino and Node REDInternet of Things Building Blocks with Arduino and Node RED
Internet of Things Building Blocks with Arduino and Node RED
John Paul Ada
 
Agile Workflow for Students - John Paul Ada
Agile Workflow for Students - John Paul AdaAgile Workflow for Students - John Paul Ada
Agile Workflow for Students - John Paul Ada
John Paul Ada
 
Crash Course Web - HTML Presentation
Crash Course Web - HTML PresentationCrash Course Web - HTML Presentation
Crash Course Web - HTML Presentation
John Paul Ada
 
Testing PHP with Codeception
Testing PHP with CodeceptionTesting PHP with Codeception
Testing PHP with Codeception
John Paul Ada
 
Pechakucha UPVTC - Psych 115 Edition - ADA
Pechakucha UPVTC - Psych 115 Edition - ADAPechakucha UPVTC - Psych 115 Edition - ADA
Pechakucha UPVTC - Psych 115 Edition - ADA
John Paul Ada
 
Foucault on Premarital Sex and Teenage Pregnancy (Short)
Foucault on Premarital Sex and Teenage Pregnancy (Short)Foucault on Premarital Sex and Teenage Pregnancy (Short)
Foucault on Premarital Sex and Teenage Pregnancy (Short)
John Paul Ada
 
Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and Docker
John Paul Ada
 
Practical AI - Building a Recommendation System
Practical AI - Building a Recommendation SystemPractical AI - Building a Recommendation System
Practical AI - Building a Recommendation System
John Paul Ada
 
Internet of Things Building Blocks with Arduino and Node RED
Internet of Things Building Blocks with Arduino and Node REDInternet of Things Building Blocks with Arduino and Node RED
Internet of Things Building Blocks with Arduino and Node RED
John Paul Ada
 
Agile Workflow for Students - John Paul Ada
Agile Workflow for Students - John Paul AdaAgile Workflow for Students - John Paul Ada
Agile Workflow for Students - John Paul Ada
John Paul Ada
 
Crash Course Web - HTML Presentation
Crash Course Web - HTML PresentationCrash Course Web - HTML Presentation
Crash Course Web - HTML Presentation
John Paul Ada
 
Testing PHP with Codeception
Testing PHP with CodeceptionTesting PHP with Codeception
Testing PHP with Codeception
John Paul Ada
 
Pechakucha UPVTC - Psych 115 Edition - ADA
Pechakucha UPVTC - Psych 115 Edition - ADAPechakucha UPVTC - Psych 115 Edition - ADA
Pechakucha UPVTC - Psych 115 Edition - ADA
John Paul Ada
 
Foucault on Premarital Sex and Teenage Pregnancy (Short)
Foucault on Premarital Sex and Teenage Pregnancy (Short)Foucault on Premarital Sex and Teenage Pregnancy (Short)
Foucault on Premarital Sex and Teenage Pregnancy (Short)
John Paul Ada
 

Recently uploaded (20)

Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 

Simple Web Services with PHP

  • 1. Simple Web Services with PHP Date: 02/23/17 Presented by John Paul Ada GAPLabs
  • 2. John Paul Ada - BA Psychology Graduate - Desktop, Web, Mobile Developer - Three years industry dev experience - Dev Community Contributor - Tech Evangelist
  • 4. Objectives ● Recognize a monolithic architecture and its problems ● Know what a web service is and its characteristics ● Know the differences between the two approaches ● Build a simple web service with PHP By the end of this session, you should be able to:
  • 5. Requirements ● Books Demo API code - https://github.com/johnpaulada/books-demo-api ● Books Demo Web code - https://github.com/johnpaulada/books-demo-web ● PHP: http://192.168.254.102:8001/php-7.1.2-Win32-VC14-x86.zip ● MySQL: http://192.168.254.102:8001/mysql-installer-community-5.7.17.0.msi ● XAMPP: http://192.168.254.102:8001/xampp-win32-7.1.1-0-VC14-installer.exe ● Insomnia: http://192.168.254.102:8001/Insomnia+Setup+4.2.14.exe ● Git: http://192.168.254.102:8001/Git-2.11.1-32-bit.exe You’ll need these tools: (SSID: CPE Laboratory; Password: CCSIT_OFFICE_1980)
  • 7. Monolithic Architecture What is a monolithic architecture? It’s a software “structure” wherein all the parts of the system are interwoven and are not separate, reusable parts. Don’t use it. It’s hard to manage these when they get huge with a lot of code and you don’t have much flexibility.
  • 8. Monolithic Architecture Problems ● Tightly coupled; changing one part might change the others ● Slow; a whole page instead of just the data ● Opinionated; you’re not giving the users a choice on how to use your data ● Not flexible; you’re limited to using only a web page
  • 10. Monolithic Architecture Code Snippet <?php $title = “Art of Seduction”; $author = “Robert Greene”; ?> <div> <p>Title: <?php echo $title; ?></p> <p>Author: <?php echo $author; ?></p> </div>
  • 11. Web Services A more modern approach/solution
  • 12. Web Services What is a web service? A web service is an application or a fraction of it which allows other applications to use it and is not tightly coupled to another application. Use this instead of monolithic architectures. This approach eliminates most of the problems posed by monolithic architectures.
  • 13. Web Service Characteristics ● Loosely coupled; changing the web service will not change the client and vice versa ● Fast; loads just the data instead of a whole web page ● Unopinionated; you’re giving the users a choice on how to use your data ● Flexible; you’re not limited to using only a web page -- you can use a desktop or mobile app
  • 15. REST APIs Most common approach to Web Services
  • 16. REST APIs What does REST stand for? REST stands for REpresentational State Transfer. What is it really? It’s just a fancy term for an approach to building web services that revolves around HTTP Methods and endpoints. What are APIs? Application Programming Interfaces. They’re the services or the libraries that allow you to use a particular service. Take for example, Facebook’s or Twitter’s APIs.
  • 17. HTTP Response HTTP/1.1 201 CREATED Date: Wed, 22 Feb 2017 12:28:53 GMT Server: Apache/2.2.14 (Win32) Last-Modified: Wed, 22 Feb 2017 12:28:53 GMT Content-Length: 29 Content-Type: application/json Connection: Closed {“title”: “Art of Seduction”}
  • 18. HTTP Request POST /books HTTP/1.1 Host: localhost Content-Type: application/json {“title”: “Art of Seduction”}
  • 19. HTTP Codes ● 2XX - Request success ● 3XX - Redirects ● 4XX - Client’s fault ● 5XX - Server’s fault
  • 20. Common HTTP Codes ● 200 - OK ● 201 - Created ● 204 - No Content ● 301 - Moved Permanently ● 400 - Bad Request ● 401 - Unauthorized ● 403 - Forbidden ● 404 - Not Found ● 500 - Internal Server Error
  • 21. REST Endpoints Request to/from collection /collection_name; e.g. /books Request to/from a specific object /collection_name/:id; e.g. /books/1
  • 22. CRUD with REST Read all books GET /books Read a book GET /books/1 Create a book POST /books Update a book PUT /books/1 Remove a book DELETE /books/1