Response class

The interface of the Fetch API represents the response to a request. You can create a new object using the Response.Response() constructor, but you are more likely to encounter a object being returned as the result of another API operation—for example, a service worker FetchEvent.respondWith, or a simple fetch().

Implemented types
Available Extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

Response([dynamic body, ResponseInit? init])
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

error() Response
json(dynamic data, [ResponseInit? init]) Response
redirect(String url, [int? status = 302]) Response