Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

CPURLConnection (and presumably anything related) don't use the HTTP_X_REQUESTED_WITH header

#231

If I use CPURLConnection to request a resource, it doesn't include the de-facto standard "HTTP_X_REQUESTED_WITH = XMLHttpRequest" which all other major JS libraries do.

The resource I am accessing depends on this header to return a json/xml response rather than the fully rendered html page. This is the preferred approach to adding in query parameters for choosing response type.

Reported by Andrew Ingram · March 2nd, 2009 @ 03:47 AM

State: resolved
Milestone: 0.7
Assigned to: nobody

Activity

  1. Francisco Tolmasky
    Francisco Tolmasky
    • Tag changed from ajax, cpurlconnection to @to-acknowledge, ajax, cpurlconnection

    Hi Andrew, could you point me to a resource that better explains this?

    March 21st, 2009 @ 04:01 AM

  2. Andrew Ingram
    Andrew Ingram

    I first encountered it when using AJAX with Django, this link explains that the major JS libraries use the header:

    http://docs.djangoproject.com/en....http.HttpRequest.is_ajax

    I've not been able to find a definitive reference for this, but it seems to be an emerging standard.

    For example, on a site I'm developing, I've made the search result pages use this header to determine whether to render the full html or to just return a JSON representation of the content. If I can get cappuccino to use this header I can make utilities built on top of the site just by accessing the normal site but with AJAX requests - no need for a seperate API.

    March 23rd, 2009 @ 07:41 AM

  3. admin (at 280north)
    admin (at 280north)
    • State changed from new to resolved
    • Milestone set to 0.7

    (from [2e32688ad68a8b5f021e6624d71c40d45b29a2f4]) Add support for x-requested-with in CPURLConnection [#231 CPURLConnection (and presumably anything related) don't use the HTTP_X_REQUES... state:resolved milestone:0.7] http://github.com/280north/cappu...

    April 19th, 2009 @ 10:55 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.