Below is the response I get while requesting a Post web service via Flutter. When I try the same web service using postman, I get the expected response. What am I missing?
<html>
<head><title>308 Permanent Redirect</title></head>
<body>
<center><h1>308 Permanent Redirect</h1></center>
<hr><center>nginx</center>
</body>
</html>
Below is my code :
var params = {
"hostName": 'something',
"username": 'something',
"password": 'something'
}
var postBody = json.encode(params);
var uri = Uri.encodeFull('http://{{api_url}}/account/authenticate');
var response = await http.post(uri, body: postboy, headers: {HttpHeaders.contentTypeHeader: " application/json"});
print response.body;