pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/socketry/async-http/discussions/160

ef="https://github.githubassets.com/assets/github-6e7c458caf1e80bb.css" /> How to post multipart form data? · socketry/async-http · Discussion #160 · GitHub
Skip to content
Discussion options

You must be logged in to vote

Here is an example of how to post the data directly: https://github.com/socketry/async-rest/blob/ae3d6da90d6fa8383304bfc66d334954e857dcb2/lib/async/rest/wrapper/form.rb#L27-L33

Regarding files, you'll need to construct a multipart body. Actually, there isn't a good mechanism for this but this might be a good start: https://github.com/socketry/multipart-post/blob/2b1235a25bc3ff03d907785caa83f09c69d6f501/lib/multipart/post/multipartable.rb

Doing it in-memory is okay if you have enough memory/swap to do so.

Beyond that, what we should probably introduce is Protocol::HTTP::Multipart which does streaming from disk/memory. multipart-post has most of the pieces but it was primarily designed for N…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@jakeonfire
Comment options

@jakeonfire
Comment options

@ioquatix
Comment options

@jakeonfire
Comment options

@ioquatix
Comment options

Answer selected by jakeonfire
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy