Loading ...
Sorry, an error occurred while loading the content.

Default Connection Header

Expand Messages
  • nwientge
    I m building a RESTful Rails app and need all of my AJAX requests to include this header: YAHOO.util.Connect.initHeader( Accept , text/javascript ); Is there
    Message 1 of 3 , Dec 7, 2008
    • 0 Attachment
      I'm building a RESTful Rails app and need all of my AJAX requests to include this header:

      YAHOO.util.Connect.initHeader("Accept", "text/javascript");

      Is there a way to extend the Connection Manager Class to always include this header?
    • Satyam
      The Connection Manager is a collection of static methods and no properties so it cannot be extended. You can have a function that does the initializing and
      Message 2 of 3 , Dec 8, 2008
      • 0 Attachment
        The Connection Manager is a collection of static methods and no
        properties so it cannot be extended. You can have a function that does
        the initializing and calls asyncRequest for you, after all, this header
        is probably not the only thing you have more or less fixed across your
        application.

        Satyam


        nwientge wrote:
        > I'm building a RESTful Rails app and need all of my AJAX requests to include this header:
        >
        > YAHOO.util.Connect.initHeader("Accept", "text/javascript");
        >
        > Is there a way to extend the Connection Manager Class to always include this header?
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - http://www.avg.com
        > Version: 8.0.176 / Virus Database: 270.9.15/1835 - Release Date: 07/12/2008 16:56
        >
        >
      • tssha
        ... include this header? Yes. Just add the third argument -- true -- to this method to indicate the header is to be issued for all transactions. For example:
        Message 3 of 3 , Dec 8, 2008
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, "nwientge" <nick@...> wrote:
          >
          > I'm building a RESTful Rails app and need all of my AJAX requests to
          include this header:
          >
          > YAHOO.util.Connect.initHeader("Accept", "text/javascript");
          >
          > Is there a way to extend the Connection Manager Class to always
          include this header?

          Yes. Just add the third argument -- true -- to this method to
          indicate the header is to be issued for all transactions.

          For example:
          YAHOO.util.Connect.initHeader("Accept", "text/javascript", true);

          Regards,
          Thomas
        Your message has been successfully submitted and would be delivered to recipients shortly.