reportProblem method

Future<Response> reportProblem(
  1. String authCode,
  2. String sessionId,
  3. String deviceId,
  4. String stationId,
  5. String problem,
  6. String description,
)

Implementation

Future<http.Response> reportProblem(
    String authCode,
    String sessionId,
    String deviceId,
    String stationId,
    String problem,
    String description) async {
  var jsonBody = {
    "auth_code": authCode,
    "session_id": sessionId,
    "device_id": deviceId,
    "station_id": stationId,
    "problem": problem,
    "description": description
  };
  var url = Uri.parse(APIConst.reportProblem);

  Map<String, String> headers = {
    "Content-type": "application/x-www-form-urlencoded",
    'Accept': 'application/json'
  };

  //print('REQUEST ::: ' + json_body.toString());

  return await http
      .post(url, headers: headers, body: jsonBody)
      .timeout(Duration(seconds: timeOutSecond));
}