How to make HTTPS request using HttpClient in dart

2019-07-12 18:37发布

问题:

I'm using HttpClient from dart (dart:io package, NOT dart:http) and I'd like to send an HTTPS request. Is there a way to do that? I can't seem to find a method that would allow me that.

回答1:

new HttpClient().getUrl(Uri.parse('https://www.somedomain.com'));