getWellknownSupport method
Gets server admin contact and support page of the domain.
Like the well-known discovery URI,
this should be accessed with the hostname of the homeserver by making a
GET request to https://hostname/.well-known/matrix/support
.
Note that this endpoint is not necessarily handled by the homeserver. It may be served by another webserver, used for discovering support information for the homeserver.
Implementation
Future<GetWellknownSupportResponse> getWellknownSupport() async {
final requestUri = Uri(path: '.well-known/matrix/support');
final request = Request('GET', baseUri!.resolveUri(requestUri));
final response = await httpClient.send(request);
final responseBody = await response.stream.toBytes();
if (response.statusCode != 200) unexpectedResponse(response, responseBody);
final responseString = utf8.decode(responseBody);
final json = jsonDecode(responseString);
return GetWellknownSupportResponse.fromJson(json as Map<String, Object?>);
}