Web API
Web API
NET CORE
Bhrugen
Patel
www.bhrugen.com
WHAT IS AN API?
API is the acronym for Application Programming Interface,
which is a software intermediary that allows two applications
to talk to each other.
Request
Response
Client Server
API SIMPLIFIED
Request / Order
Request / Order
API
API
HTTP
OVERVIE
W
HOW HTTP WORKS?
Verb
Headers
Content
Request
Client Server
HOW HTTP WORKS?
POST
Content Length: 9
Parky API
Request
Response
Client Server
Status code
Headers
Content
HOW HTTP WORKS?
POST
Content Length: 9
Parky API
Request
Response
Client Server
201
Content Type: text
Parky API
THE REQUEST OBJECT
verb
HTTP Verbs / Actions
• GET : Fetches/Requests Resource
headers
• POST: Creates/Inserts Resource
• PUT : Updates/Modifies Resource
• PATCH : Updates/Modifies Partial Resource
• DELETE : Deletes/Removes Resource
• More verbs…
content
THE REQUEST OBJECT
verb
Request’s Metadata
• Content Type : Content’s Format
headers
• Content Length : Size of the Content
• Authorization : Who is making the request
• Accept : What are the accepted type(s)
• More headers…
content
THE REQUEST OBJECT
verb
Request’s Content
• HTML, CSS, XML, JSON
headers
• Information for the request.
• Blobs etc.
content
THE RESPONSE OBJECT
Status code Status Codes for Operation Result
• 100-199: Informational
headers • 200-299: Success
• 200 – OK
• 201 – Created
• 204 – No Content
• 300-399: Redirection
• 400-499: Client Errors
content • 400 – Bad Request
• 404 – Not Found
• 409 – Conflict
• 500-599: Server Errors
• 500 – Internal Server Error
THE RESPONSE OBJECT
Status code
Response’s Metadata
• Content Type : Content’s Format
headers
• Content Length : Size of the Content
• Expires : When is this invalid
• More headers…
content
THE RESPONSE OBJECT
verb
Content
• HTML, CSS, XML, JSON
headers
• Blobs etc.
content
REpresentational State Transfer
• Client and Server are separate.
• All Server Requests are stateless.
• Cacheable Request
What is Issues:
Made with by
Free creative
templates, charts,
diagrams and maps
for your outstanding
presentations
https://www.showeet.co
m/