New to Dart and writing an HTTP server using Shelf and I can't seem to find a straightforward way to grab my posted form data (and uploads) from the Request
object -- not sure why a simple thing like this has been deliberately made hard? There's a getter called params
on the Request
object but it seems to return path params (now why would anyone break a well known pattern like this?)? Sorry, end of rant, can someone with more understanding please help?
How do I access posted form data and files when using Shelf?
28 views Asked by Sunder At
1
Here is a possible solution using only native dart,
Flow is
get form data as a string
url decode the form data string using the dart Uri class
again with the Uri class parse the form data to a map.