POST de formulário de várias partes com meio-fio

require ‘curb’c = Curl::Easy.new(“http://localhost:3000/api/companies”)c.multipart_form_post = truec.http_post(Curl::PostField.content(‘company[name]’, “rajeev”), Curl::PostField.content(‘company[rep_name]’, “Awesome”), Curl::PostField.content(‘company[rep_designation]’, “daa”), Curl::PostField.content(‘company[rep_image]’, “my_id”), Curl::PostField.content(‘company[company_large_logo]’, “d”), Curl::PostField.content(‘company[company_small_logo]’, “sds”), Curl::PostField.content(‘company[company_social_contacts]’, “my_id”), Curl::PostField.content(‘company[company_writeup]’, “my_id”), Curl::PostField.content(‘company[website]’, “Some”), Curl::PostField.content(‘company[active]’, “1”), Curl::PostField.file(‘logo_attributes’, “spec/support/dogs.png”))puts c.body_str

Continuar lendo