RequestHeaders class
Provides efficient HTTP header access with caching.
Constructors
- RequestHeaders(HttpHeaders _headers)
Properties
- accept → String?
-
Gets Accept header.
no setter
- acceptLanguage → String?
-
Gets Accept-Language header.
no setter
-
Gets Authorization header.
no setter
- bearerToken → String?
-
Gets Bearer token from Authorization header.
no setter
- contentLength → int?
-
Gets Content-Length header as int.
no setter
- contentType → String?
-
Gets Content-Type header.
no setter
-
Gets Cookie header.
no setter
- forwardedFor → String?
-
Gets X-Forwarded-For header (proxy support).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String?
-
Gets Host header.
no setter
- ifModifiedSince → String?
-
Gets If-Modified-Since header.
no setter
- ifNoneMatch → String?
-
Gets If-None-Match header (ETag).
no setter
- origin → String?
-
Gets Origin header (CORS).
no setter
- realIp → String?
-
Gets X-Real-IP header (proxy support).
no setter
- referer → String?
-
Gets Referer header.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userAgent → String?
-
Gets User-Agent header.
no setter
Methods
-
clearCache(
) → void - Clears cache.
-
get(
String name) → String? - Gets a header value by name (case-insensitive).
-
getAll(
String name) → List< String> ? - Gets all values for a header name.
-
has(
String name) → bool - Checks if a header exists.
-
hasAll(
List< String> names) → bool - Checks if multiple headers exist.
-
hasAny(
List< String> names) → bool - Checks if any header exists.
-
matches(
String name, Pattern pattern) → bool - Checks if header matches pattern.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts headers to a JSON-encodable map.
-
toList(
) → List< MapEntry< String, String> > - Gets all headers as list of key-value pairs.
-
toMap(
) → Map< String, String> - Gets all headers as a map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited