Hi All,
Here is my main.dart :
Future<HttpClient> getData() async {
Map<String, String> connection = {
'grant_type': 'string',
'branchcode': 'string',
'password': 'string',
'username': 'string',
'dbname': 'string',
'dbuser': 'string',
'dbpassword': 'string',
'dbtype': 'string+'
};
http.Response r = await http.get(uri);
print(r.statusCode);
print(r.body);
}
ERROR !
I/flutter ( 9316): 400
I/flutter ( 9316): <HTML><HEAD><TITLE>Bad Request</TITLE>
I/flutter ( 9316): <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
I/flutter ( 9316): <BODY><h2>Bad Request - Invalid Hostname</h2>
I/flutter ( 9316): <hr><p>HTTP Error 400. The request hostname is invalid.</p>
I/flutter ( 9316): </BODY></HTML>
I cannot take access token with this getData() function, it return "Bad Request - Invalid Hostname". How can ı fix this problem ? Am ı change Future<> method, async or http methods ?