How can I send a multipart POST request? #181
Comments
Do you want to send a It may make sense to add this functionality to cohttp or to create a new library, say, "multipart-form-data", and have that depend on cohttp for header processing. Or perhaps the functionality should start in cohttp and be split out if it seems to be getting large. This would make the extension of cohttp's header processing easier, for example. As you know, you can probably directly compose a |
Yep, |
Hi, |
I pushed my WIP parser to https://github.com/cryptosense/multipart-form-data while I'm refining the API. Once it's stable enough we can discuss if it's better to keep it as an external repo or if it's better maintained as part of cohttp. Le me know what you think. |
I'd definitely like to integrate this into Cohttp... |
Sweet! Been waiting for something like this for a while, glad it's finally happen. For clarification, does this currently implement sending multipart/form-data or is it just for parsing? I'd be happy to add sending if that's something you still need, as I have written (somewhat fragile) code for this in the past and I'd be happy to contribute it/refine it if that's something that's needed. |
Great! I think that we can centralize the development on cryptosense/multipart-form-data until we can have a feature-complete PR. There are indeed a couple things that are not satisfying. In particular:
Thanks to everyone interested! |
@emillon I just tried your library - it seems to be working fine! How close is it to being released? |
I fixed the performance issue and we're using it in production without problems. The file API is not super satisfying but can be improved later. I think I'll prepare a PR on cohttp in the next few days if you're OK with that plan. |
That would be great - thanks! |
@emillon just wanted to check in on the status of this PR, as it would be good to get it into a release. Also could the license be ISC to match the current repo (as the multipart-form-data is currently MIT -- almost the same but different :-) |
Currently working on it - the current blockers are 1/ figuring out how Oasis works (that part is mostly OK) 2/ where to make this fit in The |
I am recommending to use multipart_form or multipart-form-data in the README, which will be integrated in the library documentation. Closing this for now. |
How can I send a multipart POST request (ie with the Client module)? I'm using the lwt-based API, if that's important.
Currently, I'm working on some bindings for the Inbox API and need to send a multipart request to upload an email attachment.
The text was updated successfully, but these errors were encountered: