I have a post function that posts a object to server. But I get this error: Unhandled Exception: Invalid argument(s): Invalid request body "Instance of 'UserModel'"
Future<void> login(UserModel loginUser) async {
String apiUrl = Constants.apiUrl + '/api/auth/login';
http.Response response = await http.post(Uri.parse(apiUrl),
headers: {'Content-Type': 'applicataion/json'}, body: loginUser);
}
What is my mistake?