Method: Viddler::Request#run

Defined in:
lib/viddler/request.rb

#run(&block) ⇒ Object

Send http request to Viddler API.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/viddler/request.rb', line 52

def run(&block)
  if block_given?
    set(:params, &block)
  end
  
  if post? and multipart?
    put_multipart_params_into_body
  else
    put_params_into_url
  end
  request = RestClient::Request.execute(
     :method => http_method,
     :url => url,
     :headers => headers,
     :payload => body
   )
   self.response = parse_response(request)
end