Skip to content

v0.4.6

Latest

Choose a tag to compare

@iyifr iyifr released this 15 Jul 16:13

0.4.6

  • Refactored readRequestBody utility, making it more efficient and less error prone.
  • Made readRequestBody utility generic for better typing, but didn't get very far using native types.
  • Added more tests for the readRequestBody utility.

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)