Nadeem J. Qureshi
2012-Jan-18 16:29 UTC
Sending custom headers in Find method in ActiveResource:Base
Hi there, About this method: http://apidock.com/rails/ActiveResource/Base/find/class How do I set custom headers? I am communicating with a Rest API that requires a cookie. I''ve tried a lot of different things, searches and been looking for a solution a long time now. Please help. Regards, Nadeem -- 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.
Nadeem J. Qureshi
2012-Jan-22 16:10 UTC
Re: Sending custom headers in Find method in ActiveResource:Base
No one knows? I''ve tried to monkey paths rails to do this, but didn''t work. Please help :-) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/_hRWO80uxZQJ. 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.
Michael Pavling
2012-Jan-22 16:59 UTC
Re: Re: Sending custom headers in Find method in ActiveResource:Base
On 22 January 2012 16:10, Nadeem J. Qureshi <justagangsta-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No one knows?I don''t think anyone really knows what you''re asking. What do you mean by "custom headers" in a find? Headers have nothing to do with an AR find. Are you talking about browser headers (I guess it''s something to do with a browser, as you mention cookies, but you don''t say anything else about the problem domain.> I''ve tried to monkey paths rails to do this, but didn''t work.What "didn''t work"? What was the functionality you were trying to achieve? How did you try to patch it? What result did you get (which as you say, wasn''t what you wanted - but *something*, even just an error, must have happened).> Please help :-)http://catb.org/esr/faqs/smart-questions.html -- 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
2012-Jan-22 17:15 UTC
Re: Re: Sending custom headers in Find method in ActiveResource:Base
On Sun, Jan 22, 2012 at 8:10 AM, Nadeem J. Qureshi <justagangsta-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No one knows? > > I''ve tried to monkey paths rails to do this, but didn''t work.In four days you haven''t yet read the ActiveResource documentation? Or just tried googling `ActiveResource headers` ?!? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder 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.
Michael Pavling
2012-Jan-22 17:40 UTC
Re: Re: Sending custom headers in Find method in ActiveResource:Base
On 22 January 2012 16:59, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What do you mean > by "custom headers" in a find? Headers have nothing to do with an AR > find.Of course... you pointed the ActiveResource, and I''ve assumed ActiveRecord. Sorry for that. But still, you''re not really doing enough to answer your own question: http://www.google.co.uk/#q=rails+activeresource+setting+custom+headers -- 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.
Nadeem Qureshi
2012-Jan-22 17:58 UTC
Re: Sending custom headers in Find method in ActiveResource:Base
I''ll try to rephrase: I''m trying to forward a cookie from the user-end to the API that receives the request from ActiveResource::Base.find What I want to be able to do in my Controller is this: User.find(1, :headers => { :cookies => session[''user''] } And have this send the cookie from the user browsing my site, to the API that is specified in self.site. I''m sorry for ambiguity earlier. Hopefully it is clearer now :-) -- 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.
Nadeem J. Qureshi
2012-Jan-25 14:49 UTC
Re: Sending custom headers in Find method in ActiveResource:Base
This guy understood my problem, and answered accordingly: http://prblm.aakashd.com/rails-activeresource-httpauthorization-header -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/KEuuz5z9vqEJ. 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.