谷歌飞镖http客户端的问题

时间:2013-07-21 04:16:17

标签: httpclient dart

所以我升级了我的IDE和SDK,现在以下代码不再起作用了。我在这里添加一些文本试图绕过这个网站法西斯验证在帖子上非常积极。

String URL = "http://www.google.com";
Future future = client.getUrl(Uri.parse(URL))
    .then((HttpClientRequest request) {
        return request.close();
    }).then((HttpClientResponse response) {
        print('Status code: ${response.statusCode}');
        print('Headers\n${response.headers}');
    });
}); 

我现在收到以下异常。

Uncaught Error: Bad state: No elements
Stack Trace:

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

在Windows上使用Dart 0.6.3.3_r24898为我工作。

您确定这是您拥有的所有代码吗?在堆栈跟踪中,我看到WebSocketImpl,您使用的是WebSockets吗?