Choosing between package:html, dart:html, dart:io (class HttpClient) and package:http APIs to fetch HTTP resources

拟墨画扇 提交于 2019-12-04 12:19:36

The html package is a HTML parser which allows to work with HTML server side. I wouldn't expect it to get some HttpRequest capabilities.

The http package aims to provide a unified API for client and server Dart code. The API in dart:html is only a wrapper over the API the browser provides. The HttpRequest API in dart:io was built without browser restrictions and thus deviates from dart:html. package:http provides an unified API which delegates to dart:html when run in the browser and to dart:io when run on the server.

I think package:http is future proof and cross-platform and should be a good fit for your requirements.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!