ResponseEntity.tooManyRequests constructor

ResponseEntity.tooManyRequests({
  1. Object? body,
  2. int? retryAfter,
  3. Map<String, Object>? headers,
})

Implementation

ResponseEntity.tooManyRequests({
  Object? body,
  int? retryAfter,
  Map<String, /* String | List<String> */ Object>? headers,
}) : this(
        HttpStatus.tooManyRequests.value,
        body: body ??
            'Too many requests.${retryAfter != null ? ' Please try again in $retryAfter seconds.' : ''}',
        headers: {
          if (headers != null) ...headers,
          if (retryAfter != null) HttpHeaders.retryAfter: '$retryAfter',
        },
      );