Http GET method for getting an object



Implement Get Method

In this section we will implement Get action methods in our Web API controller class that will handle HTTP GET requests.

As per the Web API naming convention, action method that starts with a work "Get" will handle HTTP GET request. We can either name it only Get or with any suffix. Let's add our first Get action method and give it a name GetById because it will return specific  product by using Id from the DB. Following an appropriate naming methodology increases readability and anybody can understand the purpose of a method easily.


#Web #API #Restful #Service #RestAPI #core #API2

Post a Comment

Previous Post Next Post