So, here is what I am trying to do :-

login_response = RestClient.post 'Some URL', :userName => 'username', 
:password => 'password'  // Here I am logging in to the site. 
puts "login_response"  // Here I am getting the response as an xml format 
which is a session_id

So for accessing the content after login, I need session id to perform CRUD 
operations.

search = RestClient.get 'URL after login to search a list'    // here need 
to pass the session id. Or any suggestions what need to do in this case ?

On Friday, September 14, 2012 5:20:11 PM UTC+5:30, Jordon Bedwell wrote:
>
> On Fri, Sep 14, 2012 at 4:12 AM, Avi <aavinas...@gmail.com <javascript:>> 
> wrote: 
> > Hello, 
> > 
> > How can I pass session id through my rails application to a rest client 
> > through HTTParty or RestClient? 
>
> I would consider this a security problem, and a major one at that but 
> whatever who am I judge your bad security. You need to serialize the 
> object, I don't know about the default session handler but I think it 
> responds to load and dump and even if it doesn't you can always use 
> Marshal to Marshal the object but that means that the guy down the way 
> needs some of your code possibly to unmarshal it. 
>

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/1mNPYA_deAAJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to