putRequest<T> method
Implementation
Future<HtpioResponse<T>> putRequest<T>({
required String endpoint,
required dynamic data,
required T Function(Map<String, dynamic>) fromJson,
String? authToken,
}) async {
Map<String, String> headers = {
'Content-Type': 'application/json',
if (authToken != null) 'Authorization': 'Bearer $authToken',
};
final request = HtpioRequest<T>(
url: endpoint,
method: 'PUT',
headers: headers,
body: jsonEncode(data),
fromJson: fromJson,
);
return send(request);
}