utils/body_utils library

Properties

map Map<String, Type>
getter/setter pair

Functions

convertToDouble(dynamic json) double
convertToList<T>(dynamic json, T itemConverter(dynamic)) List<T>
convertToMapStringInt(dynamic json) Map<String, int>
Common converter functions
convertToMapStringString(dynamic json) Map<String, String>
parseBodyAsJson<T>({required List<int> bytes}) → T?
parseBodyWithConverter<T>(List<int> bytes, JsonConverter<T> converter) → T?
Parse JSON body with custom type conversion
parseRequestBody<T>(HttpRequest request, {Duration timeout = const Duration(seconds: 360)}) FutureOr<T?>
readRequestBody<T>(H4Event event) Future<T?>
Read the incoming HTTP event request body. Generically typed.

Typedefs

JsonConverter<T> = T Function(dynamic json)
Type converter function signature for converting JSON values