1

Im trying to send a json file in post request. this json contains a list, but the list is sent empty although the rest of the values are assigned. here is the json argus

'post_argus= {"fileName"=>"T", "Available"=>"yes", "Devices"=>[{"Device"=>"PC"}, {"Device"=>"iPad"}, {"Device"=>"iPhone"}]}'

Devices list is empty but fileName and available have values. any help?

Henrik Andersson
  • 45,354
  • 16
  • 98
  • 92
user1926689
  • 21
  • 1
  • 5
  • This is a Ruby Hash, do you know how to serialize it to JSON? Is that part working for you? Check this for help otherwise: http://stackoverflow.com/questions/10919287/make-this-http-post-request-in-ruby – Henrik Andersson Aug 20 '13 at 10:02
  • yes. this how it looks in json '{ "fileName":"T", "Available": "yes", "Devices":[{"Device": "PC"}, {"Device": "iPad"},{"Device": "iPad"}] }' – user1926689 Aug 20 '13 at 10:05
  • It would be useful to know how you send the POST request and how you parse it on the client side. Without additional information, all this is just guesswork. Please try to construct a minimal failing example. – Patrick Oscity Aug 20 '13 at 11:10
  • Relevant? http://blog.assimov.net/blog/2010/06/01/postput-arrays-with-ruby-nethttp-set_form_data/ – Dan Grahn Aug 20 '13 at 13:22
  • All I want to know is whether the Devices list are correctly written or not. as I said its sent empty compared to the other parameters. – user1926689 Aug 20 '13 at 13:26

0 Answers0