I'd like to post a multiline param with Net::HTTP in Ruby. I tried adding \n or \r\n in the param string but it just arrives at destination as \n or \r\n.
Net::HTTP开发者_JAVA百科.post_form(URI.parse('http://mysite.com/post/uri'),{'param'=>'value','multiline_data'=>'data_line1\ndata_line2'})
How can I achieve that?
Line feeds in URL's are usually encoded as %0D%0A. You need to break your sentences using this to receive a multi line input on the other end.
精彩评论