We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
first_name
language
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.
parts
value
String
Hash
The text was updated successfully, but these errors were encountered:
I would like this to be implemented too, but you could do something like this:
sub_params = { :'contact[first_name]' => 'prathamesh', :'contact[language]' => 'Ruby' } params = sub_params.merge({ "file" => UploadIO.new(csv, "text/csv", "test.csv") }) request = Net::HTTP::Post::Multipart.new(url.path, params)
to get the desired params in Rails.
Sorry, something went wrong.
@nicosantangelo / @prathamesh-sonpatki , if you just continue the work I did i my pull request (#30) I think you can solve this pretty easy :-)
It would be good to support this. PR welcome.
No branches or pull requests
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_name
andlanguage
are delimited. But they should be not.Right now,
parts
are created assuming thatvalue
isString
. So it is failing here wherevalue
isHash
like in case of nested hash.The text was updated successfully, but these errors were encountered: