Uploading form data in Dart

Victor Uvarov
1 min readAug 25, 2019

Dart is a client-optimized language, written by google, for creating fast apps on any platform. Dart is famous for being the core language that powers Google’s UI toolkit for mobile, web, and desktop called Flutter.

We have two choices in libraries when it comes to working with HTTP requests. Either use the default HTTP package or the easier to use dio package.

Uploading form data using the HTTP package:

Upload form data using the Dio package:

Conclusion

I would highly recommend using dio over the HTTP package because the dio API is clear and simple to use. Dio also supports more advanced features such as Interceptors, FormData, Request Cancellation, File Downloading, Timeout, etc.

--

--