Wednesday, October 11, 2023

Web API HTTP requests and responses.

 Request Verbs: 

The HTTP verbs such as GET, POST, PUT, and DELETE  they will  describe what should be done with the Web API resource. 

For example, if you want to  read, create, update or delete an entity? The HTTP Verbs GET, PUT, POST, and DELETE are the most commonly used verbs in real-time applications. 

Request Header: 

When a client sends the request to the server, the request contains a header and a body. The header of the request contains some additional information such as what type of response the client required. For example, the client wants the response to be in XML or JSON format.

Request Body: 

The Request Body contains the data that you want to send to the server. For example, a POST request contains the data in the Request Body for the new item that you want to create. The data may be in the form of XML or JSON.


Response Body: 

The Response Body contains the data that is sent as a response from the server. For example, if you request a specific employee, then the response body includes the employee details either in the form of XML or JSON.

Response Status codes: 

The Response Status Codes are the HTTP status codes that will specify the status of the request. The most common status codes are 200/OK, 204/No Content, 500/Internal Server Error, and 404/Not Found. 

 In ASP.NET Web API, an action method that returns void will send the status code 204 No Content 

No comments:

Post a Comment

Thank you for visiting my blog

Kubernetes

Prerequisites We assume anyone who wants to understand Kubernetes should have an understating of how the Docker works, how the Docker images...