checkpoint
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import 'dart:io';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/io_client.dart';
|
||||
|
||||
class HttpClientFactory {
|
||||
static http.Client createClient({bool allowSelfSigned = false}) {
|
||||
if (allowSelfSigned) {
|
||||
final ioClient = HttpClient()
|
||||
..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
|
||||
return IOClient(ioClient);
|
||||
}
|
||||
return http.Client();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user