globalTimeline function
Attempts to retrieve a map of all notes on the supplied instance and instances federated with it. If this fails, an error map is returned.
Implementation
Future<Map<String,dynamic>> globalTimeline(
String baseUrl,
String apiBase,
bool withFiles,
bool withRenotes,
bool withReplies,
int noteCount
) async {
Map<String,dynamic> headers = new Map();
headers['Content-Type'] = 'application/json';
Map<String,dynamic> payload = new Map();
payload['withFiles'] = withFiles;
payload['withRenotes'] = withRenotes;
payload['withReplies'] = withReplies;
payload['limit'] = noteCount;
String reqUrl = '$baseUrl$apiBase/notes/global-timeline';
Map<String,dynamic> userInfo = await fetchJSON(
'POST',
headers,
payload,
reqUrl
);
return userInfo;
}