I have to pass parameters between two rails apps. In one side (sender) I have an array of hashes. I have a code like the following to send the data:
http = Net::HTTP.new('localhost', '3030') result = http.post('/processar_lotes', my_array_of_hashes)
Some questions
- Is there any (kind of) serialize or something like this that I can pass to the other app?
- At the other side, how can I de-serialize the information?
- Is there a limit to the size of what I pass as a parameter?
To answer your questions:
to_xmlmethod, or theto_jsonmethod. You can also use Ruby’s Marshal object.from_json,from_xml,Marshal.load, or your own custom reader.