2
我已经使用新的API ServiceStack这样一直:如何实现组合使用ServiceStack与自定义REST API定制ResponseStatus
[Route("/me/login/")]
public class LoginRequest : IReturn<LoginResponse>
{
public string password { get; internal set; }
public string username { get; internal set; }
}
public class LoginResponse
{
public string token { get; set; }
}
...
client.PostAsync(new LoginRequest { username = email, password = password });
然而,服务器是一个Django REST Api。所以,当我键入密码incorrent我得到如下回应:
{
"non_field_errors": [
"Unable to login with the given credentials."
]
}
我怎样才能检索到的non_field_errors
财产利用新ServiceStack API的信息? (我应该重写什么?)