Method: HTTP::Requestor#put_multipart
- Defined in:
- lib/http_requestor_multipart.rb
#put_multipart(path = "", data = {}, headers = nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/http_requestor_multipart.rb', line 16 def put_multipart(path="", data={},headers=nil) @uri = URI.parse(@defaults[:domain] + path) unless path.empty? build_data(data) req = Net::HTTP::Put.new(@uri.request_uri) req.initialize_http_header(headers) unless headers.nil? req.body = @post_body req["Content-Type"] = "multipart/form-data; boundary=#{@boundary}" res = @http.request(req) @post_body = "" @boundary = "" res end |