Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby multipart refactor #31

Open
noraj opened this issue May 26, 2020 · 0 comments
Open

Ruby multipart refactor #31

noraj opened this issue May 26, 2020 · 0 comments

Comments

@noraj
Copy link
Contributor

noraj commented May 26, 2020

Linked to global issue #30

ref

To send multipart/form-data use Net::HTTPHeader#set_form:

req = Net::HTTP::Post.new(uri)
req.set_form([['upload', File.open('foo.bar')]], 'multipart/form-data')

set_form

So requiring a external gem is not longer required.

<#if util.atLeastOneMultipart(requests)>
require "net/http/post/multipart"
# Psst! It require an additional gem : gem install multipart-post
</#if>

But the rest of the code need to be updated the standard library syntax instead of the external gem DSL.

@noraj noraj mentioned this issue May 26, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant