updateSession method

Future<Response> updateSession(
  1. String authCode,
  2. String sessionId,
  3. String sessionOutput,
  4. String status,
)

Implementation

Future<http.Response> updateSession(String authCode, String sessionId,
    String sessionOutput, String status) async {
  var url = Uri.parse(APIConst.updateSession);
  Map<String, String> headers = {
    "Content-type": "application/x-www-form-urlencoded",
    'Accept': 'application/json'
  };
  var jsonBody = {
    "auth_code": authCode,
    "session_id": sessionId,
    "session_output": sessionOutput,
    "status": status
  };

  log('UPDATE_SESSION_REQUEST :::$url :: $jsonBody');

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