String url = 'http://localhost:49430/#/';
Future save() async {
var b = json.encode({'email':user.email, 'password':user.password});
var res = await http.post(Uri.parse(url),
headers: {'Content-Type' : 'application/json'},
body : b,);
print(b);
print(res.body);
}
I am attempting to post the username and password, although when I try to print the json body, it returns as empty. There is a server response of 404, which I believe points to the URL being wrong, although it is not. When I print string b, it prints correctly, so it is clearly something to do with the server.
When I print(Uri.base), it returns with the same URL.