the data you send is in the payload when we try to use rest_client.post or any method like get, put which rest_client do
def self.post(url, payload, headers={}, &block) Request.execute(:method => :post, :url => url, :payload => payload, :headers => headers, &block) end
so what we want to accomplish
response = RestClient.post api_url, {:file => file, :multipart => true }, { :params =>{:foo => 'foo'}
therefore, the execute command will take {:file => file, :multipart => true } as a payload and { :params =>{:foo => 'foo' } } as a header, so to transfer all this you need
response= RestClient::Request.execute(:method => :post, :url => api_url, :payload => {:file => file, :multipart => true }, :headers => { :params =>{:foo => 'foo'}}, :timeout => 90000000)
it should do
source share