put method
Implementation
Future<http.Response> put(String path, Map<String, dynamic> body) async {
DRFAuth auth = DRFAuth(cleanBaseUrl(baseUrl), usernameField, cleanPath(tokenPath), cleanPath(refreshPath));
final token = await auth.getTokenWithRefresh();
if (token == null) {
throw Exception("User is not logged in or token refresh failed.");
}
final headers = {
'Authorization': 'Bearer $token',
'Accept': 'application/json',
'Content-Type': 'application/json',
};
final response = await http.put(
Uri.parse('${cleanBaseUrl(baseUrl)}${cleanPath(path)}'),
headers: headers,
body: jsonEncode(body),
);
return response;
}