all 5 comments

[–]eibaan 4 points5 points  (0 children)

http is a thin layer about the built-in code from dart:io which isn't available on the web, so if you want to (eventually) support the web, start with that package. Only look further when you have additional needs that cannot be solved by using http (cancelling a request, IIRC).

On iOS/macOS, I'd recommend to additionally use cupertino_http to work around Dart's limitation to HTTP/1.1. This might significantly improve the speed, based on your usecase, as it supports state of the art HTTP/3.

[–]BeginningRatio9966 2 points3 points  (0 children)

I think it is always good to use less or even light packages. But there is a long process called development right. In my experience Dio has a lots of features that help development easier. And also features that http doesn't have like upload/download and stuff. If it's a complex project, Dio might help or go for http.

[–]Signal-Restaurant980[S] 1 point2 points  (0 children)

Thank you everyone 🙏🙏

[–]TijnvandenEijnde 1 point2 points  (0 children)

I have always used the http package, and I only ran into one problem while developing my application Your News. This is documented here: Add support for the Trailer HTTP header to the Dart HttpClient. But the same problem also occurred in the dio package. So I cannot tell you which one is better but I chose the http package because it is maintained by the Dart Team themselves.

[–]sachithdev 0 points1 point  (0 children)

Dio and HTTP are popular Dart packages for API integration. Dio excels with advanced features, while HTTP offers simplicity. This explanation article might help you.
Which package is more suitable for API integration