ping static method

Future<AppInstall> ping(
  1. PingRequest pingRequest
)

Implementation

static Future<AppInstall> ping(PingRequest pingRequest) async {
  return await http.post(Uri.parse('$_apiUrl/ping'),
      body: json.encode(pingRequest.toJson()),
      headers: {HttpHeaders.contentTypeHeader: 'application/json'}).then((response) {
    if (response.statusCode == 200) {
      return AppInstall.fromJson(json.decode(response.body));
    } else {
      throw Exception('Response code: ' + response.statusCode.toString() + ', ' + response.body);
    }
  });
}