HttpClient client = new HttpClient();
HttpClientConnection connection = client.openUrl('get', new Uri.fromString("http://localhost:8383/users"));
connection.onResponse = (HttpClientResponse response){
List<int> content = response.inputStream.read(response.contentLength);
String contentString = new String.fromCharCodes(content);
print(contentString);
};
connection.onError = (Exception e){
print("error");
print(e);
};
I've looked into the docs and the source code for HttpClient and SocketIOException - but I can't find any explanation for this type of error. Also I've tried accessing the url from a browser and it works fine.
Any suggestions?
Thanks..
http.get("http://localhost:8383/users")..then((response) {print(response.body);})..handleException((ex) {print("error");print(ex);});