RequestHeaders class Null safety
The interface defining the HTTP headers that can be provided to HttpOperation. The headers can be used for example to correlate multiple operations in the backend: a header with an identifier can be provided to the HttpOperation, and the header will be included in the HTTP request. If the identifier can be associated with a more general operation (like a user enrollment), the backend will be able to link the requests made by the SDK with that more generic operation.
This interface tracks header values line-by-line. A field with multiple comma-separated values on the same line will be treated as a field with a single value by this class. It is the caller's responsibility to detect and split on commas if their field permits multiple values. This simplifies use of single-valued fields whose values routinely contain commas, such as dates.
See HttpOperation
Constructors
-
RequestHeaders({required List<
String> namesAndValues}) -
Creates a RequestHeaders objects from a list of strings.
factory
-
RequestHeaders.create(Map<
String, String> headers) -
Creates a RequestHeaders objects from a map of strings.
factory
-
RequestHeaders.fromJson(Map<
String, dynamic> json) -
Alternate constructor that creates a RequestHeaders from a json.
factory
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
-
namesAndValues
→ List<
String> -
A list containing the name of the headers and the associated values.
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
fromJson(
Map< String, dynamic> json) → dynamic -
Returns a value of the type you specify, deserialized from a JSON object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Returns a JSON-encoded representation of the value you supply.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited