operate method

Future<Map<String, dynamic>> operate(
  1. RequestParam param
)

This method is used to request the other insterface but login.

param For building the request paramaters. You should use the implemented class.

Implementation

Future<Map<String, dynamic>> operate(RequestParam param) async {
  if (_domain == null) throw Exception("domain msut be not null");
  String url = _domain! + _prefix + param.getRequestPath() + _suffix;
  var resp = await _postJson(url, jsonEncode(param.toJson()));
  if (resp.statusCode != HttpStatus.ok) throw Exception("http error, http status code is ${resp.statusCode}.");
  String body = await resp.transform(utf8.decoder).join();
  return param.parseResponse(body);
}