i am unable to sent data from ajax to api controller in my project ......i have written a method in api's controller but its not calling while running code it calls get method everytime ...
i need help
i did everything that required to pass data in json format....
If you have done something wrong when following a first example, it could be better to just show how us what you have done. If we just provide yet another sample you may still run into the same issue/error or you won't understand what was wrong with your
current approach loosing an occasion to learn from this error.
For now my understanding is that you are trying to post data to your web api controller but still this is the "get" method which is invoked.
Member
43 Points
56 Posts
data read problem
Oct 11, 2014 05:01 AM|srp_beginner|LINK
i am unable to sent data from ajax to api controller in my project ......i have written a method in api's controller but its not calling while running code it calls get method everytime ...
i need help
i did everything that required to pass data in json format....
if anybody knws ans tell me
All-Star
48490 Points
18068 Posts
Re: data read problem
Oct 11, 2014 08:08 AM|PatriceSc|LINK
Hi,
Try perhaps http://www.codeproject.com/Tips/678138/MVC-using-Web-API-and-JQuery-to-GET-or-POST-Data What happens if for a start you don't post to method named the same way?
If you have done something wrong when following a first example, it could be better to just show how us what you have done. If we just provide yet another sample you may still run into the same issue/error or you won't understand what was wrong with your current approach loosing an occasion to learn from this error.
For now my understanding is that you are trying to post data to your web api controller but still this is the "get" method which is invoked.