getDiscoveryInformationsByUserId method
Gets discovery information about the domain. The file may include additional keys.
Implementation
Future<DiscoveryInformation> getDiscoveryInformationsByUserId(
String SDNIdOrDomain,
) async {
try {
final response = await httpClient.get(
Uri.https(SDNIdOrDomain.domain ?? '', '/.well-known/sdn/client'));
var respBody = response.body;
try {
respBody = utf8.decode(response.bodyBytes);
} catch (_) {
// No-OP
}
final rawJson = json.decode(respBody);
return DiscoveryInformation.fromJson(rawJson);
} catch (_) {
// we got an error processing or fetching the well-known information, let's
// provide a reasonable fallback.
return DiscoveryInformation(
mNode:
NodeInformation(baseUrl: Uri.https(SDNIdOrDomain.domain ?? '', '')),
);
}
}