I want to send some nested params with the file. Is it not getting send properly.
For example
sub_params = { contact: { 'first_name' => 'prathamesh', 'language' => 'Ruby' } }
params = sub_params.merge({ "file" => UploadIO.new(csv, "text/csv", "test.csv") })
request = Net::HTTP::Post::Multipart.new(url.path, params)
On Rails side, i get
Parameters: {"contact"=>"{\"first_name\"=>\"prathamesh\", \"language\"=>\"Ruby\"}", "file"=>#<ActionDispatch::Http::UploadedFile:0x0000000628cea8 ....}
Nested attributes first_name and language are delimited. But they should be not.
Right now, parts are created assuming that value is String. So it is failing here where value is Hash like in case of nested hash.
I want to send some nested params with the file. Is it not getting send properly.
For example
On Rails side, i get
Nested attributes
first_nameandlanguageare delimited. But they should be not.Right now,
partsare created assuming thatvalueisString. So it is failing here wherevalueisHashlike in case of nested hash.