I'm new to the this topic MVC4 and Web api. My question could be basic but do help me.
I used (http://localhost:3668/api/values) and (http://localhost:3668/api/values/3) to call the methods get and get(int id) to get executed. But don't know how to call the Post and delete method in api controller thanks.
Add a comment
|
2 Answers
You cannot just punch the addresses into your favorite browser. A flexible solution for development and debugging is a command line tool like curl (http://curl.haxx.se/) which is capable of sending HTTP GET, POST, PUT, DELETE etc.
In order to consume the api from your application then it all depends on your client technology. If you are making a browser based application you can use xmlhttprequest to send GET, POST, PUT, DELETE requests. If you need server to server communication you can use System.Net.WebClient.