cryptosense / multipart-form-data

multipart/form-data (RFC2388) parser for OCaml
BSD 2-Clause "Simplified" License
19 stars 6 forks source link

Improve `parse` API #14

Closed emillon closed 7 years ago

emillon commented 7 years ago

Previously it would call a single function for all parts. This does not really represent the common use cases, where the caller knows what part names to expect.

Using the callbacks argument, one can pass an association list mapping expected part names to:

An extra default_callback argument is provided for parts whose name is not known in advance, which is not usual but keeps the generality of the former API.