post static method

Future<Response> post(
  1. String path, {
  2. Map<String, dynamic> params = const {},
  3. String body = "",
  4. bool tokenRequired = true,
})

Implementation

static Future<http.Response> post(
  String path, {
  Map<String, dynamic> params = const {},
  String body = "",
  bool tokenRequired = true,
}) async {
  var uri = Uri.parse(path);
  uri.replace(queryParameters: params);
  final headers = await _getHeaders(RequestType.post);
  final response = await http
      .post(uri, headers: headers, body: body)
      .timeout(const Duration(seconds: 300), onTimeout: () {
    return decorateResponse(http.Response('Time out exception', 504));
  });
  return decorateResponse(response);
}