[ANN] http-multipart-formdata v3.0.1 released

Dear OCamlers,

I am pleased to announce v3.0.1 of http-multipart-formdata. This release follows a major overhaul of the parser as well as the design of the library. Here is the summary of changes:

  1. Flatten module Part_header to part_header
  2. Implement reader/pull based parser to retrieve multipart parts, i.e. implement a streaming design. This is very useful if the HTTP file upload is large.
  3. Implement push-based incremental input model, i.e. the library is now a non-blocking multipart parser
  4. Remove dependency on IO based libs such as lwt, async since it is no longer needed due to point 3 above.

Github repo: http-multipart-formdata
API doc : API manual

Bikal Lem


Thanks for your work on that. I’m curious about the different “multipart” libraries now available for OCaml – anyone has a brief comparison of them?

Are there functional differences? Correctness? Performance? Or just a matter of style and co-development?

Thanks, Hannes

One obvious difference among the three is http-multipart-formdata doesn’t depend on any IO/Promise libraries, such as lwt or async. so you may find it easier to integrate in your project.

mulitpart-form-data exposes a callback based streaming api, whereas http-multipart-formdata exposes a non-callback, non-blocking based streaming API.

The API surface of http-multipart-formdata is kept as low as possible, primarily 3 API calls - boundary, reader and read call.

The dependency list of http-multipart-formdata is the thinnest. This may or may not be an issue depending on your aesthetics. However, relatively/comparatively the less your dependencies, the easier it is to integrate the lib with other OCaml libs and environments such as various OSes.

1 Like

I should also add http-multipart-formdata has been implemented with zero-copy streaming and minimal allocation in mind.

1 Like