Class: Vzaar::Request::Multipart
- Inherits:
-
Struct
- Object
- Struct
- Vzaar::Request::Multipart
- Defined in:
- lib/vzaar/request/multipart.rb
Constant Summary collapse
- CRLF =
"\r\n"
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file
3 4 5 |
# File 'lib/vzaar/request/multipart.rb', line 3 def file @file end |
#path ⇒ Object
Returns the value of attribute path
3 4 5 |
# File 'lib/vzaar/request/multipart.rb', line 3 def path @path end |
Instance Method Details
#request ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/vzaar/request/multipart.rb', line 6 def request req = Net::HTTP::Post.new(path) req.body = build_body req["Content-Type"] = "multipart/form-data; boundary=#{boundary}" req["Content-Length"] = req.body.size req end |