put abstract method

Future<Either<Failure, Response>> put({
  1. required String endpoint,
  2. Object? data,
  3. Map<String, dynamic>? params,
  4. Duration? receiveTimeout,
  5. Duration? sendTimeout,
  6. Map<String, String>? headers,
  7. ProgressCallback? onSendProgress,
  8. ProgressCallback? onReceiveProgress,
  9. CancelToken? cancelToken,
  10. bool showLoader = true,
})

Sends a PUT request to endpoint.

Use for full replacement of a resource. The request body in data should contain the complete updated representation.

Example:

final result = await _api.put(
  endpoint: '/users/42',
  data: updatedUser.toJson(),
);

Implementation

Future<Either<Failure, Response>> put({
  required String endpoint,
  Object? data,
  Map<String, dynamic>? params,
  Duration? receiveTimeout,
  Duration? sendTimeout,
  Map<String, String>? headers,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
  CancelToken? cancelToken,
  bool showLoader = true,
});