Breaking

Search Here

26 September 2023

API Implementation Steps

API Implementation 

Why Use API

---------------------------

API means ---> Application Programming Interface

If we use API development Light weight Maintainable Web services

API Allows Access Data from web browsers, mobile app and other devices

Web api also support JSON, XML and other data formats

Benifits

------------------

Web API is a better choice for simpler, light weight services

WEB API can use any text format including XML and is faster than WCF 

If works the way HTTP works using standard, 

HTTP verbs like GET, POST, PUT, DELETE for all the crud operation

In this API Using Classes hierarchy

In this API using HttpResponceMessage

Status Code : 402

--------------------------------

422 Un-processable Content response status code

Indicates that the server understands the content type of the request entity

And the syntax of the request entity is correct, but it was unable to process the contained instructions.


Status Code : 204

-----------------------------------

NoContent means --> No data for search filters

Status Code : 200 

----------------------------------

Getting Results --> it means 200 response is the generic OK.

And may or may not have a body attached 

Status Code : 201

----------------------------------------

a 201 response is for when the request specifically creates something and does not have a response body

it means create new resource

Status Code : 204

---------------------------------------

a 204 response is for when the request succeeds but has no body

Status Code : 403 

-----------------------------

The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it. 

Status Code : 401

--------------------------------

This status is similar to 403 , but for the 403 Forbidden status code, re-authenticating makes no difference.

Status Code : 205

-----------------------------

The HTTP Status Code 205 means that the server successfully processed the client's request, and the server asks that the client reset its document view, and that is not returning any content.

Status Code : 404

--------------------------------

Not found

Status Code : 500

-------------------------------

Internal Server Error

Status Code : 203

------------------------------

If you encounter a 203 status code in response to an HTTP request, it indicates that the server has successfully processed the request and has returned a response from a cache or proxy server rather than the original source of the information.

it means --> bad request

Rest API supports MVC Routing Concepts

-------------------------------------------------------------


No comments:

Post a Comment

Hello all, if you have any doubt feel free comment

Comments