Skip to Content
Mastering ASP.NET Web API
book

Mastering ASP.NET Web API

by Mithun Pattankar, Malendra Hurbuns
August 2017
Intermediate to advanced
330 pages
7h 26m
English
Packt Publishing
Content preview from Mastering ASP.NET Web API

Level 2

Level 2 is for the use of HTTP verbs. So in level 1, we introduced resources, and level 2 introduces verbs.

Using the preceding example, when you post what you ate at 10 a.m., the server will give you back a resource. Using this resource, you can perform GET on that resource and see the details of what you ate at 10 a.m.:

    GET: diet/ate/12789 
    Response  
    { 
      'time':'10:00', 
      'apple':'1', 
      'water':'2' 
    } 

You can then update these details using PUT; note that we are acting on the same resource.

The request is as follows:

    PUT: diet/ate/12789 
    { 
      'time':'10:00', 
      'tea':'1', 
      'muffin':'3' 
    } 

You can also delete this resource if you realize later on that you didn't eat at 10 a.m.:

    DEL : diet/ate/12789 

We used the same resource with a different ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical ASP.NET Web API

Practical ASP.NET Web API

Badrinarayanan Lakshmiraghavan
Pro ASP.NET Web API: HTTP Web Services in ASP.NET

Pro ASP.NET Web API: HTTP Web Services in ASP.NET

Tugberk Ugurlu, Alexander Zeitler, Ali Kheyrollahi

Publisher Resources

ISBN: 9781786463951Supplemental Content