put static method
Implementation
static Future<dynamic> put(
{required String path, int? port, required Map<String, dynamic> body, String? token}) async {
final Uri uri = DdxHttpRequest.generateUri(path: path, port: port);
final Map<String, String> headers = DdxHttpRequest.generateHeaders(token: token);
http.Request request =
DdxHttpRequest.generateRequest(method: DdxHttpConst.method.put, headers: headers, uri: uri, body: body);
DdxLogger.httpRequest(httpRequest: request);
try {
final streamedResponse = await request.send().timeout(DdxHttpConfig.networkTimeLimit);
final result = await http.Response.fromStream(streamedResponse);
return DdxHttpResponse.get(result);
} on TimeoutException {
DdxException.requestTimeout();
} on DdxException {}
}