-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http.get : SocketException #264
Comments
It's giving you an OS error - "No route to host". Looks like a problem with the environment - what do you think needs to happen in this package? |
The exception only is thrown when access 'https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty' . When accessing other urls, it works fine. |
Can you access that url otherwise on your device? Does it work if you use https://api.dartlang.org/stable/2.2.0/dart-io/HttpClient-class.html directly? |
my fault, found reason: hacker-news.filrebase.io.com is blocked by china government. |
The Code is:
void _requestArticleIDList () async {
var url = 'https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty';
var response = await http.get(url);
if (response.statusCode != 200 ) {
return;
}
}
The Result I Get
E/flutter ( 5470): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: SocketException: OS Error: No route to host, errno = 113, address = hacker-news.firebaseio.com, port = 46698
E/flutter ( 5470): #0 IOClient.send
package:http/src/io_client.dart:33
E/flutter ( 5470):
E/flutter ( 5470): #1 BaseClient._sendUnstreamed
package:http/src/base_client.dart:169
E/flutter ( 5470):
E/flutter ( 5470): #2 BaseClient.get
package:http/src/base_client.dart:32
E/flutter ( 5470): #3 get.
package:http/http.dart:46
E/flutter ( 5470): #4 _withClient
package:http/http.dart:166
The text was updated successfully, but these errors were encountered: