Module: Vzaar::OAuthExt::Multipart

Defined in:
lib/vzaar/ext/oauth.rb

Instance Method Summary collapse

Instance Method Details

#create_http_request(http_method, path, *arguments) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/vzaar/ext/oauth.rb', line 4

def create_http_request(http_method, path, *arguments)
  _params = arguments.first
  file = _params.is_a?(Hash) ? _params[:file] : nil

  if file && file.respond_to?(:read)
    uri = URI.parse(site)
    path = uri.path + path if uri.path && uri.path != '/'
    Vzaar::Request::Multipart.new(path, file).request
  else
    super(http_method, path, *arguments)
  end
end