sendRequest method
- HttpBasedRequest req,
- String endpoint
Implementation
Future<HttpBasedResponse> sendRequest(
HttpBasedRequest req, String endpoint) async {
List<int> buffer = req.writeToBuffer();
logTrace('Proto request converted to bytes buffer. Send to ${endpoint}.');
http.Response res =
await http.post(endpoint, body: {'proto': buffer.toString()});
logTrace('Server response received.');
HttpBasedResponse response = parseHttpBasedResponse(res.body);
logTrace('Server response parsed.');
return response;
}