1

I'm facing some strange issue when try to make an http post request through HttpClient and through http package and for both I receive:

[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: HttpException: Connection closed before full header was received, uri = https://dumb.api.url/api/login

The strange thing is it works through postman, curl and if done natively on Android (Kotlin). Also, there is no VPN or whatever turned on.

I know there is a lot of similar questions, but none of them helped me.

I already tried using http package, HttpClient, ioClient, Dio to make a request. I also tried to set timeouts, use delays, using badCertificates callback, cleaning the project (flutter clean), restarting IDE and device and running this both on emulator and device.

Alex.Marynovskyi
  • 1,264
  • 3
  • 16
  • 22

1 Answers1

0

From the logs provided, it looks like the request has timed out. Try creating a new Android virtual device with a different Android version or try wiping the data of the Android virtual device. This should help reset the network config of the device.

Omatt
  • 8,564
  • 2
  • 42
  • 144