I have a controller inherited from ControllerApi like this (MVC 4)
public HttpResponseMessage<lightUserInfo> Post(LogOnModel model) { if (ModelState.IsValid) { if (Membership.ValidateUser(model.UserName, model.Password)) { MembershipUser user = Membership.GetUser(model.UserName); var userinfo = new lightUserInfo(user); return new HttpResponseMessage<lightUserInfo>(userinfo); } } }
I see that the userinfo object is filled perfectly and this returns 200 OK to the browser ... but the content is just empty json {}
Here is the client side ajax in CoffeeScript
$.ajax url: Meshable.rooturl + "/api/authentication" data: JSON.stringify authenticationDetails dataType: "json" type: "POST" contentType: 'application/json; charset=utf-8' error: (e) -> success: (data) ->
source share