Skip to main content

Posts

Showing posts with the label Best Practices

ASP.NET Web (REST) API Best Practices - HTTP Verb

In our ASP.NET Web (REST) API Best Practices series, today we are going to talk about the HTTP Verb like POST, GET, PUT etc. Every verbs have specific meaning for it's associate requests. for ex. GET Use when fetching records or data from APIs. POST Use when adding records or data in APIs PUT Use when updating records or data in APIs DELETE Use when deleting records or data in APIs We covers CRUD scenario with Web APIs. we never compromise above standard like GET requests must not change any underlying resource data. In advance scenario we may requires below verbs as well PATCH Use when partially updating the records or data in APIs (Ex. only update email address properties) HEAD Use when calling APIs without needing the response data in return. Ideally use for health checking API Here is my list of HTTP verbs and their use cases, what's yours?

ASP.NET Web (REST) API Best Practices - Resource Naming Convention

In our ASP.NET Web (REST) API Best Practices series, today we are going to talk about the Resource naming. This is most important concept in designing the REST API Endpoints, It's like designer who design UI for their applications. Similar way REST API developer need to design their endpoint in way that consumer of API (developer, end user) can easily predict API Endpoints without much reading API documentations and easily integrate in their applications. So, How we design the API which are predicative and same time easy to integrate?  Well, we need to identify resource of services, and we need to exposed those services resource via endpoints. We need to identifying the resources within the system and need to expose them as nouns, not as verbs or actions. what is that means? let's understand with help of the example. Suppose we need to design the endpoints for Leaning System which have following entities, Student Teacher Course and we need to expose above resources in services...

ASP.NET Web (REST) API Best Practices

As we know that service based architecture became mandatory in every solutions since last couple of years. Because of industry needs, i also get chance to develop application which follow service oriented architecture using ASP.NET Web APIs. I'm sharing my experience about what need to be consider while designing & developing REST service. I believe following any standards in software engineering is an iterative process, which always requires constant modifications on define standards and practices. So, i listed out points which i follow and i also keep updating below points from time to time. HTTP Verb Resource Naming Convention Request Response Representation & Format