postMessage method
Implementation
Future<MessageNewResponse> postMessage(
MessageNew message, Authentication authentication) async {
http.Response response = await _httpService.post(
'/api/v1/chat.postMessage',
jsonEncode(message.toMap()),
authentication,
);
if (response.statusCode == 200) {
if (response.body.isNotEmpty == true) {
return MessageNewResponse.fromMap(jsonDecode(response.body));
} else {
return MessageNewResponse();
}
}
throw RocketChatException(response.body);
}