I tried to send object as json to controller in post method but it's raise error. what's to do?(attatched this relvant code):
public class user
{
public string username;
public string password;
}
// POST: api/User
public void Post(user u)
{
if (!database_layer.create_user(u.username, u.password))
{ throw new HttpResponseException(HttpStatusCode.BadRequest); }
}