In this C# Web REST tutorial, beginners will learn first what a C# REST API is and then what are the HTTP Verbs in C# REST API is. Learn about the HTTP Status Codes in this C# tutorial. and we will become acquainted with all of the Constraints of the C# REST API. After that, for a better learning experience, we will see a practical demonstration of C# REST API in this C# programming tutorial. Finally we will wind up this session with Few takeaways on C# REST API.
10. What is REST API?
REST is an abbreviation for Representational State Transfer. REST is a distributed system
architectural style.
11. What is REST API?
It is founded on a set of principles that defines and addresses network resources. RESTful
services communicate using HTTP (HyperText Transfer Protocol).
12. What is REST API?
The REST system communicates with external systems via web resources identified by URIs
(Uniform Resource Identifiers).
20. HTTPS Status Codes
1xx Series : Information Codes
2xx Series : Success Codes
3xx Series : Redirect Codes
4xx Series : Client Error Codes
5xx Series : Server Error Codes
21. HTTPS Status Codes
Status Code Status Description
200 OK
201 Created
202 Accepted
204 No Content
200 Series
22. HTTPS Status Codes
Status Code Status Description
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
400 Series
23. HTTPS Status Codes
Status Code Status Description
500 Internal Server Error
501 Not Implemented
503 Service Unavailable
504 Geteway Timeout
500 Series
26. Constraints of C# REST API
Uniform Interface
The uniform interface requirement specifies how clients
and servers interact.
It decouples and simplifies the design, allowing each
component to evolve independently.
27. Constraints of C# REST API
Stateless
A single client can submit many requests to the server,
but each one must be independent.
Each request must have all of the essential information
for the server to understand and process it properly.
The server must not store any information about the
client's current status in this situation.
28. Constraints of C# REST API
Client-Server
Client and server are separated due to uniform interface.
Thus, clients aren't concerned with server-side data
storage, boosting code portability.
Servers are simpler and more scalable since they don't
care about user interface or state.
If the interface isn't changed, servers and clients can be
replaced and developed independently.
29. Constraints of C# REST API
Cacheable
Since many clients connect to the same server and
often ask for the same resources, it is important that
these responses can be cached.
By doing so, unnecessary processing can be avoided,
and overall speed can be considerably improved.
30. Constraints of C# REST API
Layered System
Normally, a client cannot know whether it is connected
directly to the end server or through an intermediary.
By facilitating load balancing and providing shared
caches, intermediary servers can improve system
scalability.
Security policies can also be enforced by layers.