0% found this document useful (0 votes)
115 views

Magic Villa .NET 7 API

The document discusses building RESTful APIs with ASP.NET Core. It provides prerequisites for building APIs including skills in C#, ASP.NET Core MVC and Entity Framework Core. It then covers API fundamentals, data transfer objects, dependency injection, authentication, authorization and other topics for developing APIs.

Uploaded by

MD ASIF ALAM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views

Magic Villa .NET 7 API

The document discusses building RESTful APIs with ASP.NET Core. It provides prerequisites for building APIs including skills in C#, ASP.NET Core MVC and Entity Framework Core. It then covers API fundamentals, data transfer objects, dependency injection, authentication, authorization and other topics for developing APIs.

Uploaded by

MD ASIF ALAM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

RESTFUL API WITH ASP.

NET CORE
B u s i n e s s
C r e a ti v e

Bhrugen
Patel
www.dotnetmastery.com

co. Company profile here Company profile here


B u s i n e s s

WHAT IS AN API?
C r e a ti v e

co. Company profile here Company profile here


B u s i n e s s

“API IS AWESOME”
C r e a ti v e

co. Company profile here Company profile here


RESTFUL API WITH ASP.NET CORE
B u s i n e s s
C r e a ti v e

Bhrugen
Patel
www.dotnetmastery.com

co. Company profile here Company profile here


.NET API

PREREQUISITES
C# (3-6months)
B u s i n e s s

.NET Core MVC (CRUD)

EF Core Basics (CRUD)


C r e a ti v e

FREE MVC/EF Core Basics Course


co. Company profile here https://www.dotnetmastery.com/Home/Vlog
Company profile here
B u s i n e s s
C r e a ti v e

co. Company profile here Company profile here


.NET API

QUESTIONS/ISSUES ?
Google it!
B u s i n e s s

Check Q&A

Compare with Git Repo


C r e a ti v e

Raise a new Question on Udemy!

co. Company profile here Company profile here


.NET API

Topics Covered
API Fundamentals
B u s i n e s s

DTO’s in API

EF Core in API
C r e a ti v e

Dependency Injection

Repository Pattern

Authentication and Authorization in API

API Versioning, Filtering, Sorting, Caching etc.

Consuming API with authentication endpoints

Deploying API
co. Company profile here Company profile here
B u s i n e s s

WHAT IS AN API?
C r e a ti v e

co. Company profile here Company profile here


API
B u s i n e s s

Request

Response
C r e a ti v e

Request

Response

CLIENT SERVER

co. Company profile here Company profile here


API
B u s i n e s s

Request

Response
C r e a ti v e

Request

Response

Application API Server

co. Company profile here Company profile here


API SIMPLIFIED
B u s i n e s s

Request / Order
C r e a ti v e

Response / Cooked Food

Restaurant Table Chef

co. Company profile here Company profile here


API SIMPLIFIED
B u s i n e s s

Request / Order
C r e a ti v e

Response / Cooked Food

Restaurant Table Chef

co. Company profile here Company profile here


API SIMPLIFIED
B u s i n e s s

Request / Order
C r e a ti v e

Response / Cooked Food

Restaurant Table Chef

co. Company profile here Company profile here


HOW API WORKS?
B u s i n e s s

API
C r e a ti v e

API

API

co. Company profile here Company profile here


B u s i n e s s
C r e a ti v e

HTTP
OVERVIEW

co. Company profile here Company profile here


HOW HTTP WORKS?
B u s i n e s s

Verb
Headers
Content
C r e a ti v e

Request

Client Server

co. Company profile here Company profile here


HOW HTTP WORKS?
B u s i n e s s

POST
Content Length: 9
Magic API
C r e a ti v e

Request

Response
Client Server
Status code
Headers
Content
co. Company profile here Company profile here
HOW HTTP WORKS?
B u s i n e s s

POST
Content Length: 9
Magic API
C r e a ti v e

Request

Response
Client Server
201
Content Type: text
Magic API
co. Company profile here Company profile here
THE REQUEST OBJECT
HTTP Verbs / Actions
B u s i n e s s

verb

• GET : Fetches/Requests Resource


headers • POST: Creates/Inserts Resource
• PUT : Updates/Modifies Resource
C r e a ti v e

• PATCH : Updates/Modifies Partial Resource


• DELETE : Deletes/Removes Resource
• More verbs…
content

co. Company profile here Company profile here


THE REQUEST OBJECT
Request’s Metadata
B u s i n e s s

verb

• Content Type : Content’s Format


headers • Content Length : Size of the Content
• Authorization : Who is making the request
C r e a ti v e

• Accept : What are the accepted type(s)


• More headers…

content

co. Company profile here Company profile here


THE REQUEST OBJECT
Request’s Content
B u s i n e s s

verb

• HTML, CSS, XML, JSON


headers • Information for the request.
• Blobs etc.
C r e a ti v e

content

co. Company profile here Company profile here


THE RESPONSE OBJECT
Status Codes for Operation Result
B u s i n e s s

Status code
• 100-199: Informational
• 200-299: Success
headers • 200 – OK
• 201 – Created
C r e a ti v e

• 204 – No Content
• 300-399: Redirection
• 400-499: Client Errors
• 400 – Bad Request
• 404 – Not Found
content • 409 – Conflict
• 500-599: Server Errors
• 500 – Internal Server Error

co. Company profile here Company profile here


THE RESPONSE OBJECT
Response’s Metadata
B u s i n e s s

Status code

• Content Type : Content’s Format


headers • Content Length : Size of the Content
• Expires : When is this invalid
C r e a ti v e

• More headers…

content

co. Company profile here Company profile here


THE RESPONSE OBJECT
Status code
Content
B u s i n e s s

headers • HTML, CSS, XML, JSON


• Blobs etc.
C r e a ti v e

content

co. Company profile here Company profile here


Request Response

Verb Status code


B u s i n e s s

headers headers
C r e a ti v e

Content content

co. Company profile here Company profile here


REpresentational State Transfer
B u s i n e s s

• Client and Server are separate.


• All Server Requests are stateless.
• Cacheable Request

What is
C r e a ti v e

Issues:

REST? • REST is not perfect.

co. Company profile here Company profile here

You might also like