startSessionRequest method
Implementation
Future<dynamic> startSessionRequest(String type) async {
const String path = '/session';
const String baseUrl = BASE_URL;
final Map<String, dynamic> body = {'userId': userId, 'type': type};
final Map<String, String> headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-api-key': accessToken,
};
final response = await http.post(
Uri.parse(baseUrl + path),
body: json.encode(body),
headers: headers,
);
return json.decode(response.body);
}