0.4.6
- Refactored
readRequestBodyutility, making it more efficient and less error prone. - Made
readRequestBodyutility generic for better typing, but didn't get very far using native types. - Added more tests for the
readRequestBodyutility.
The utility can now also handle FormData request bodies, but it is recommended to use readFormData or readFiles for the standard way of reading other data types from the request body.
The utility was also made generic for stronger typing but avoid using specific types directly e.g
// Will throw type error because casting doesn't work for complex types
List<Map<String, User>>? body = readRequestBody(event)
// Preferred
// You can then use a class to improve the type or use `fromJson` helpers
List<Map<String, dynamic>>? body = readRequestBody(event)