apiPut method

Future apiPut(
  1. String url,
  2. Map<String, dynamic> payload, {
  3. bool returnPayloadOnly = true,
})

Implementation

Future<dynamic> apiPut(String url, Map<String, dynamic> payload, {bool returnPayloadOnly = true}) async {
  if (this.config != null && this.config.host != null) {
    debug("apiPut URL: ${url} With body: ${jsonEncode(payload)}");
    return http.put( Uri.parse(this.config.host + url), body: jsonEncode(payload), headers: getApiHeaders(isJson: true))
        .then((res) => processResponse(res, returnPayloadOnly));
  } else  {
    return Future.error(VasatError("No vasat configuration or host found",status: 8000));
  }

}