开发者

Net::HTTP post with multiline param

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜