Module: Http::MultipartMethods::MultipartBase

Included in:
Post, Put
Defined in:
lib/angus/remote/http/multipart_methods/multipart_base.rb

Constant Summary collapse

DEFAULT_BOUNDARY =
'-----------RubyMultipartPost'

Instance Method Summary collapse

Instance Method Details

#body=(value) ⇒ Object



14
15
16
17
18
# File 'lib/angus/remote/http/multipart_methods/multipart_base.rb', line 14

def body=(value)
  @body_parts = value.map {|(k,v)| Parts::Part.new(boundary, k, v)}
  @body_parts << Parts::EpiloguePart.new(boundary)
  set_headers_for_body
end

#boundaryObject



20
21
22
# File 'lib/angus/remote/http/multipart_methods/multipart_base.rb', line 20

def boundary
  DEFAULT_BOUNDARY
end

#initialize_http_header(initheader) ⇒ Object

prevent reinitialization of headers



9
10
11
12
# File 'lib/angus/remote/http/multipart_methods/multipart_base.rb', line 9

def initialize_http_header(initheader)
  super
  set_headers_for_body
end