Hi, I''m trying to get a captch thing running from http://textcaptcha.com/ which displays an XML file when you trail a key on that URL. I''ve tried this: @captcha = Net::HTTP.get_print URI.parse(''http:// textcaptcha.com/api/8wcmmrp2tzoc0k484kkwwkwcsdbpk70q'') in the controller of the file that I want to have access to the data, but nothing is displayed in the @captcha variable. If I direct my web browser to that URL, however, I see the correct output. I''m requiring ''net/http'' and ''uri'' in the controller. Am I missing something? Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jul 8, 7:20 am, Ali <ali.akhtarz...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I''m trying to get a captch thing running fromhttp://textcaptcha.com/ > which displays an XML file when you trail a key on that URL. I''ve > tried this: @captcha = Net::HTTP.get_print URI.parse(''http:// > textcaptcha.com/api/8wcmmrp2tzoc0k484kkwwkwcsdbpk70q'') in the > controller of the file that I want to have access to the data, but > nothing is displayed in the @captcha variable. If I direct my web > browser to that URL, however, I see the correct output. > > I''m requiring ''net/http'' and ''uri'' in the controller. Am I missing > something?All get_print is supposed to do is output the data to the console. get_response will instead return a Net::HTTPResponse object which you can play around with. Fred> > Thanks in advance.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thank you sir! On Thu, Jul 8, 2010 at 7:19 PM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Jul 8, 7:20 am, Ali <ali.akhtarz...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi, I''m trying to get a captch thing running fromhttp://textcaptcha.com/ > > which displays an XML file when you trail a key on that URL. I''ve > > tried this: @captcha = Net::HTTP.get_print URI.parse(''http:// > > textcaptcha.com/api/8wcmmrp2tzoc0k484kkwwkwcsdbpk70q'') in the > > controller of the file that I want to have access to the data, but > > nothing is displayed in the @captcha variable. If I direct my web > > browser to that URL, however, I see the correct output. > > > > I''m requiring ''net/http'' and ''uri'' in the controller. Am I missing > > something? > > All get_print is supposed to do is output the data to the console. > get_response will instead return a Net::HTTPResponse object which you > can play around with. > > Fred > > > > Thanks in advance. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.