bhavik
2011-Feb-08 00:49 UTC
URI to use to send a post request from Rails to a Tomcat-based Application
Hi, I am working on sending data via a Post request from a rails application to a java servlet running on tomcat on the same machine (localhost:8080). However when I use res = Net::HTTP.post_form(URI.parse(''http://localhost:8080/''), {''q''=>''ruby'', ''max''=>''50''}) render text: res.body It just goes to this uri http://localhost:3000/posts/submit and shows me the apache tomcat homepage It does not actually go to the tomcat application. (I could check this with breakpoints) I think I am not using the right URI. Please let me know of the right URI to use or please let me know of some sample working URIs that you know of where I can post and see the results of the post request. That would help me ascertain if the Post request is working or not. Thanks, Bhavik -- 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.
Jim Ruther Nill
2011-Feb-08 09:29 UTC
Re: URI to use to send a post request from Rails to a Tomcat-based Application
hmm, i usually use httparty<http://railstips.org/blog/archives/2008/07/29/it-s-an-httparty-and-everyone-is-invited/> for these kind of stuff so I don''t have to worry about the Net::HTTP class. On Tue, Feb 8, 2011 at 8:49 AM, bhavik <bhavik.3112-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am working on sending data via a Post request from a rails > application to a java servlet running on tomcat on the same machine > (localhost:8080). > However when I use > res = Net::HTTP.post_form(URI.parse(''http://localhost:8080/''), > {''q''=>''ruby'', ''max''=>''50''}) > render text: res.body > > It just goes to this uri http://localhost:3000/posts/submit > and shows me the apache tomcat homepage > It does not actually go to the tomcat application. (I could check this > with breakpoints) > > I think I am not using the right URI. > Please let me know of the right URI to use or please let me know of > some sample working URIs that you know of where I can post and see the > results of the post request. > That would help me ascertain if the Post request is working or not. > > Thanks, > Bhavik > > -- > 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. > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- 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.
Hassan Schroeder
2011-Feb-08 15:32 UTC
Re: URI to use to send a post request from Rails to a Tomcat-based Application
On Mon, Feb 7, 2011 at 4:49 PM, bhavik <bhavik.3112-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am working on sending data via a Post request from a rails > application to a java servlet running on tomcat on the same machine > (localhost:8080). > However when I use > res = Net::HTTP.post_form(URI.parse(''http://localhost:8080/''),> It just goes to this uri http://localhost:3000/posts/submit > and shows me the apache tomcat homepageThat ''s where you''re sending the request - why is this a surprise?> It does not actually go to the tomcat application. (I could check this > with breakpoints) > > I think I am not using the right URI. > Please let me know of the right URI to useThe "right URI" is whatever the target servlet is mapped to in that application. (The fact that it''s running on Tomcat is irrelevant; it''s the app that will process your request, not the servlet container.) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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.
dhanashree naik
2011-Mar-24 06:19 UTC
Sending request from one rails application to other rails application for authentication
Hi, I am new to rails enviornment & facing problem regarding authentication for my current project.I have one rails application where user creation & login is there.I also have another rails application in that also user creation & login is there.But now i want when i click on login action request should send from my first rails application to second rails application for authentication.Is there any way to communicate between two rails application. Please help me out here. It will be great help. Thanks -- Posted via http://www.ruby-forum.com/. -- 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.
Narendra sisodiya
2011-Mar-24 06:44 UTC
Re: Sending request from one rails application to other rails application for authentication
you can use REST way to communicate between both application. Use Active Resource, look at a this article http://www.ryandaigle.com/articles/2006/06/30/whats-new-in-edge-rails-activeresource-is-here On Thu, Mar 24, 2011 at 11:49 AM, dhanashree naik <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> Hi, > I am new to rails enviornment & facing problem regarding authentication > for my current project.I have one rails application where user creation > & login is there.I also have another rails application in that also user > creation & login is there.But now i want when i click on login action > request should send from my first rails application to second rails > application for authentication.Is there any way to communicate between > two rails application. > Please help me out here. It will be great help. > > Thanks > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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. > >-- ~N a r e n -- 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.