#231 ✓resolved
Andrew Ingram

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

Reported by Andrew Ingram | March 2nd, 2009 @ 03:47 AM | in 0.7

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.

Comments and changes to this ticket

  • Francisco Tolmasky

    Francisco Tolmasky March 21st, 2009 @ 04:01 AM

    • Tag changed from ajax, cpurlconnection to @to-acknowledge, ajax, cpurlconnection

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

  • Andrew Ingram

    Andrew Ingram March 23rd, 2009 @ 07:41 AM

    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.

  • admin (at 280north)

    admin (at 280north) April 19th, 2009 @ 10:55 AM

    • State changed from “new” to “resolved”
    • Milestone set to 0.7

    (from [2e32688ad68a8b5f021e6624d71c40d45b29a2f4]) Add support for x-requested-with in CPURLConnection [#231 state:resolved milestone:0.7] http://github.com/280north/cappu...

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Cappuccino Web Framework, including AppKit, Foundation, and Objective-J.

Shared Ticket Bins

People watching this ticket

Referenced by

Pages