Hi,
I''m using the ActiveResource (beta) gem. I need to change the header
fields for the request.
There is "default_header" in ActiveResource::Connection which is
"Content-type: application/xml". I do not see how to change that.
Could someone give me a hint.
TIA & regards,
chris
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
> There is "default_header" in ActiveResource::Connection which is > "Content-type: application/xml". I do not see how to change that. > Could someone give me a hint.class Project < ActiveResource::Base headers[''X-Token''] = ''foo'' end Adds the X-Token header to all requests. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
2007/5/2, DHH <david.heinemeier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: Hello,> > There is "default_header" in ActiveResource::Connection which is > > "Content-type: application/xml". I do not see how to change that. > > Could someone give me a hint.> class Project < ActiveResource::Base > headers[''X-Token''] = ''foo'' > end > > Adds the X-Token header to all requests.Thank you for your help. The "headers" methods isn''t yet included in the ActiveResource gem. However, due to your hint, I downloaded at the SVN sources and it works. regards, chris --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> Thank you for your help. The "headers" methods isn''t yet included in > the ActiveResource gem. However, due to your hint, I downloaded at the > SVN sources and it works.Pushed the latest as beta gems. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---