Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Web APIs

Memi Lavi
www.memilavi.com
Web API:

An API exposed by a web component,

allowing other components to interact with

it
Common Characteristics of Web API
• Platform Agnostic

The Internet

Web
.NET API Python
Common Characteristics of Web API
• Standard Protocols over HTTP

The Internet

Web
.NET HTTP API Python
Common Characteristics of Web API
• Usually Request / Response based

The Internet

HTTP Request Web


.NET API Python
HTTP Response
Web API Types

• Differentiated mainly by:

• Request Format

• Request Contents

• Response Format

• Response Contents
Web API Types

• SOAP

• REST

• GraphQL

• gRPC
SOAP

• Simple Object Access Protocol

• Designed in 1998 for Microsoft

• XML-Based

• RPC Style

• Extensible
SOAP
SOAP

• Outdated

• Do not use, unless have to


REST

• Representational State Transfer


• Built around entities, not operations
• Designed in 2000 by Roy Fielding
• Built on the HTTP standard
• Message Style
• Extremely simple to implement
• The most popular Web API today
REST

• Uses URL for entity identification:


/api/v1/order/17/items
• Usually returns JSON:

JSON
Structure of REST API Response

Status

Headers

Body
GraphQL

• From the next section on…


gRPC

• Developed by Google in 2015

• Uses HTTP/2

• Uses Protobuf as the messaging format

• Supports bi-directional & streaming messaging


gRPC
gRPC

• Quite performant

• Not widely used yet

• Requires specialized libraries at both ends

You might also like