TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Omprakash Amarwal
NA
47
3.8k
How to get Json format data in WebApi
Oct 2 2015 4:34 AM
I want to get Json Data from WebApi when i call apiController it can return Xml data.
here is
ShowDataController
= ApiController
Sp_GetAllData()
= Storeprocedure which contains simple select query
public class ShowDataController : ApiController
{
public IEnumerable<Sp_GetAllData_Result> Get()
{
AngulerEntities db = new AngulerEntities();
List<Sp_GetAllData_Result> res = db.Sp_GetAllData().ToList();
return res;
}
}
when i run this
http://localhost:10127/api/ShowData
it will return xml data
if i use string type of method in ApiController and which is using
JavaScriptSerializer().Serialize()
string output = new JavaScriptSerializer().Serialize(res);
return output;
it will return xml in json data.
now i want to get Only json data while calling apiController.
Reply
Answers (
3
)
how to show do like comment button like FB plz help
Parameter Pass to Rdlc Report