I'm currently using the http lib for a normal http connection. Does anyone know how to implement a certificate check into the http call so I can use SSL? I can't seem to find a clear answer on how to do this.
Here is a sample connection in my app:
import 'package:http/http.dart' as http;
String url = "https://www.mywebsite.com";
print("Firing off url: ${url}");
var request = http.MultipartRequest("POST", Uri.parse("${url}"));
//cert check here maybe?
//add POST fields
request.fields["lookup"] = "true";
request.fields["email"] = "blah@test.com";
request.fields["user_id"] = "1337";
var response = await request.send();
var responseData = await response.stream.toBytes();
var responseString = String.fromCharCodes(responseData);
print('================================');
print("response was: ${responseString}");
if (response.statusCode == 200) {
var json_data = json.decode(responseString);
for (var u in json_data) {
print(u["response"]);
}
}