Web Api framework is Http based and can be accessed from broad range of clients like Browser, Mobile App etc.
REST uses some common HTTP methods to insert/delete/update/retrieve information. These Http methods are: 1.GET - Requests a specific representation of a resource 2.PUT - Creates or updates a resource with the supplied representation 3.DELETE - Deletes the specified resource 4.POST - Submits data to be processed by the identified resource
Data Type supported:
- XML
- JSON
- ATOM
My Blogs
Add BlogDelete Blog
public class BlogPost { public int Id {get; set;} public string Title {get; set;} public string Content {get; set;} public string Labels {get; set;} } public namespace SampleWebApi.Controllers { using System.Net; using System.Net.Http; using System.Web.Http; public class BlogController:ApiController { static Listposts = new List { new BlogPost{ Id = 1, Title= "Web Api Framework on .NET", Content = "services exposed over plain HTTP", Labels= "" }, new BlogPost{ Id = 2, Title= "MVC4", Content= "Mobile Support", Labels= "" }, new BlogPost{ Id = 3, Title = "KnockoutJS", Content= "Javascript based MVVM framework", Labels= ""} }; public BlogPost GetBlogPost(int id) { return posts.Find(m => m.Id == id); } public IEnumerable GetAllPosts() { return posts; } public BlogPost PostBlog(BlogPost post) { posts.Add(post); return post; } public void PutBlog(int id, BlogPost post) { var blog = posts.Find(m => m.Id == id); blog.Title = post.Title; blog.Content = post.Content; } public void DeleteBlog(int id) { var post = posts.Find(m => m.Id == id); posts.Remove(post); } } }
This comment has been removed by the author.
ReplyDeleteWoah this blog is wonderful i like studying your posts. Keep up the great work! You understand, lots of persons are hunting around for this info, you could help them greatly.
ReplyDeletepython training Course in chennai | python training in Bangalore | Python training institute in kalyan nagar
After reading your post I understood that last week was with full of surprises and happiness for you. Congratz! Even though the website is work related, you can update small events in your life and share your happiness with us too.
ReplyDeleteJava training in Indira nagar | Java training in Rajaji nagar
Java training in Marathahalli | Java training in Btm layout
Well researched article and I appreciate this. The blog is subscribed and will see new topics soon.
ReplyDeleteData Science Course in Indira nagar | Data Science Course in Electronic city
Python course in Kalyan nagar | Data Science course in Indira nagar
Data Science Course in Marathahalli | Data Science Course in BTM Layout
I would really like to read some personal experiences like the way, you've explained through the above article. I'm glad for your achievements and would probably like to see much more in the near future. Thanks for share.
ReplyDeletedevops online training
aws online training
data science with python online training
data science online training
rpa online training
Casino Restaurants - Las Vegas - MapyRO
ReplyDeleteFind Casino Restaurants in the Las Vegas area 삼척 출장샵 and other. 보령 출장안마 Make 공주 출장샵 restaurant 천안 출장마사지 reservations and read reviews. No reviews are 여주 출장마사지 posted yet. © 2021 Mapyro.