AppEngineHttpRequest.fromJson constructor
AppEngineHttpRequest.fromJson(
- Object? j
Implementation
factory AppEngineHttpRequest.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return AppEngineHttpRequest(
httpMethod: switch (json['httpMethod']) {
null => HttpMethod.$default,
Object $1 => HttpMethod.fromJson($1),
},
appEngineRouting: switch (json['appEngineRouting']) {
null => null,
Object $1 => AppEngineRouting.fromJson($1),
},
relativeUri: switch (json['relativeUri']) {
null => '',
Object $1 => decodeString($1),
},
headers: switch (json['headers']) {
null => {},
Map<String, Object?> $1 => {
for (final e in $1.entries)
decodeString(e.key): decodeString(e.value),
},
_ => throw const FormatException('"headers" is not an object'),
},
body: switch (json['body']) {
null => Uint8List(0),
Object $1 => decodeBytes($1),
},
);
}