How to fix HttpException: Connection closed before full header was received

后端 未结 11 2739
不知归路
不知归路 2020-12-03 02:22

I have recently upgraded my flutter version in my app. But when I want to debug the application, it shows me the following error.

Error connecting to the service prot

11条回答
  •  感情败类
    2020-12-03 03:03

    I got the same error when I using Flutter with http package.

    import 'package:http/http.dart' as http;
    ...
    http.Response response =  http.get('url')
    

    This was fine. But when I went to get the response.statusCode, it Error connecting error.

    I found that I'm using SSR/v2Ray on my pc. I fix it by setting the proxy on Android Emulator extended controls panel.

提交回复
热议问题