class HTTP::FormData::Part

Represents a body part of multipart/form-data request.

@example Usage with String

body = "Message"
FormData::Part.new body, :content_type => 'foobar.txt; charset="UTF-8"'

Attributes

content_type[R]
filename[R]

Public Class Methods

new(body, content_type: nil, filename: nil) click to toggle source

@param [#to_s] body @param [String] content_type Value of Content-Type header @param [String] filename Value of filename parameter

# File lib/http/form_data/part.rb, line 23
def initialize(body, content_type: nil, filename: nil)
  @io = StringIO.new(body.to_s)
  @content_type = content_type
  @filename = filename
end