Error Serializing The Response
Contents |
here for a quick overview of the site Help Center Detailed error serializing the response please check the server logs response class answers to any questions you might have Meta Discuss com alamofire error serialization response the workings and policies of this site About Us Learn more about Stack Overflow the
Com Alamofire Serialization Response Error Data
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Domain Com Alamofire Error Serialization Response
Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Failed to serialize the response in Web API with Json up vote 39 down vote favorite 13 I am working error serializing value with ASP.NET MVC 5 Web Api. I want consult all my users. I write: api/users and I receipt this: "The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'" In WebApiConfig, already I added this lines: HttpConfiguration config = new HttpConfiguration(); config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType); config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; But still doesn't work My function for return data is this: public IEnumerable
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Error Serializing Value Of Type
and policies of this site About Us Learn more about Stack Overflow error serializing object class the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags serialization error c# Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only http://stackoverflow.com/questions/23098191/failed-to-serialize-the-response-in-web-api-with-json takes a minute: Sign up failed to serialize the response in Web API up vote 72 down vote favorite 23 I was working on ASP.NET MVC web API, I'm having this error: The 'ObjectContent`1' type failed to serialize the response body for content type 'application/xml; charset=utf-8'. My controller is: public Employee GetEmployees() { Employee employees = db.Employees.First(); return employees; } http://stackoverflow.com/questions/12641386/failed-to-serialize-the-response-in-web-api why I m getting this error? c# serialization asp.net-web-api share|improve this question edited Jan 6 '14 at 20:20 abatishchev 57k56214353 asked Sep 28 '12 at 13:53 Tamal kanti Dey 361135 6 The exception you are seeing is a general exception, which can be caused by any number of factors. Check the InnerException property of the serialization exception to find out what exactly caused the serialization to fail. –Display Name Sep 28 '12 at 14:35 Can you share the code for your Employee type? It might be because the type Employee is not serializable... –Maggie Ying Oct 4 '12 at 3:07 Also have a look at this stackoverflow.com/questions/8173524/… –sttaq Jun 4 '13 at 19:40 add a comment| 14 Answers 14 active oldest votes up vote 101 down vote For me this was a problem with circular referencing. The accepted answer did not work for me because it only changes the behaviour of the JSON formatter, but I was getting XML when I called the service from the browser. To fix this, I switched off XML an
Sign in Pricing Blog Support https://github.com/AFNetworking/AFNetworking/issues/3516 Search GitHub This repository Watch 1,809 Star https://social.msdn.microsoft.com/Forums/vstudio/en-US/a5adf07b-e622-4a12-872d-40c753417645/web-api-error-the-objectcontent1-type-failed-to-serialize-the-response-body-for-content?forum=wcf 27,272 Fork 8,656 AFNetworking/AFNetworking Code Issues 143 Pull requests 25 Projects 0 Wiki Pulse Graphs New issue Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={com.alamofire.serialization.response.error.response=
the response body for content type..... .NET Framework > Windows Communication Foundation, Serialization, and Networking Question 1 Sign in to vote Hi I am new to web Api, and I am getting this error: