Skip to content

Ruby multipart refactor #31

@noraj

Description

@noraj

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions