RestRequest class

A cohesive definition for RestRequestTransformer's instance fields.

Constructors

RestRequest({Map<String, String>? headers, String? method, Map<String, dynamic>? supplementalTopLevelData, String? topLevelKey, String? url})
const
RestRequest.fromJson(Map<String, dynamic> data)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
final
method String?
The HTTP method for the request. DELETE, GET, PATCH, POST, and PUT are supported.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supplementalTopLevelData Map<String, dynamic>?
This map is merged at the same level as the topLevelKey in the payload. For example, given supplementalTopLevelData: {'other_key': true}, the payload would become {"topLevelKey": ..., "other_key": true}. It is strongly recommended to avoid using this property. Your data should be managed at the model level, not the query level.
final
topLevelKey String?
When serializing to REST, the payload may need to be nested within a top level key. Similarly, when deserializing to REST, the response may be nested within a top level key. If no key is defined, the first value will be returned during deserialization.
final
url String?
The URL of the endpoint to invoke. This is appended to baseEndpoint. Example:
final

Methods

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

Operators

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