getUserInfo function
Attempts to return the information about a user profile as a map. If this fails, an error as a map is returned.
Implementation
Future<Map<String,dynamic>> getUserInfo(
String userName,
String server,
String baseUrl,
String apiBase
) async {
Map<String,dynamic> headers = new Map();
headers['Content-Type'] = 'application/json';
Map<String,dynamic> payload = new Map();
payload['username'] = userName;
payload['host'] = server;
payload['detailed'] = true;
String reqUrl = '$baseUrl$apiBase/users/show';
Map<String,dynamic> userInfo = await fetchJSON(
'POST',
headers,
payload,
reqUrl
);
return userInfo;
}