Is it recommended to return json data from a web api method ?
This I am using for jqgrid.
I am using WebApi for all other operations like Get, Update, Delete etc…
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
WebApi supports Content Negotation. This means that it will give you what you ask for. WebApi will inspect the header of your request and will then return the data in the correct format.
In case of an AJAX application using jqGrid, you will probably ask for JSON. That’s the easiest format to use in JavaScript.
If someone else would call your WebApi method and ask for Xml, your method would return Xml to the caller.