GWSend function

Future<Response> GWSend(
  1. String apiName, {
  2. Map<String, dynamic>? postdata,
})

GWSend: 發送GW類型的API 發送GW類型的API要加上GW使用的header資訊

Implementation

Future<http.Response> GWSend(String apiName,{Map<String,dynamic> ?postdata}) async {
  if(postdata == null) postdata = {};
  postdata["app_id"] = Globals.app_id;
  postdata["device_id"] = Globals.device_id;
  postdata["device_uuid"] = Globals.device_uuid;

  return Send(
      "${Globals.GWUrl}/$apiName",
      postdata: jsonEncode(postdata).toString(),
      header: httpHeader()
  );
}