From: Enrique Comba Riepenhausen Date: 2007-05-26T05:26:53+09:00 Subject: Re: Net::HTTP - POST and GET in the same request On 25 May 2007, at 22:15, subsume@gmail.com wrote: > I have a peculiar problem where I need to submit POST data to a script > which has get variables (script.asp?variable=true) > > But Net:HTTP seems to have gone to great lengths to prevent this. > Obviously, its messy and looked down upon but unfortunately I cannot > control this. > > Running tests: > > body = > Net::HTTP.post_form(URI.parse('http://www.server.net/post.php?x=y'), > {'A'=>'1','B'=>'2','C' => '3'}) > > puts body.body > > --------- > > Above, the POST variables are the only ones which hit the server. > Apparently everything after the '?' is totally ignored. Please help! > > -- > Posted via http://www.ruby-forum.com/. > Try the following: http = Net::HTTP.new('http://www.server.net') response = http.post('/post.php', 'x=y', {'A'=>'1','B'=>'2','C' => '3'}) puts response.body Hope it helps! ---- Enrique Comba Riepenhausen ecomba@mac.com I always thought Smalltalk would beat Java, I just didn't know it would be called 'Ruby' when it did. -- Kent Beck