#707 enhancement
Jim Higson

Cannot make a head request using Ajax

Reported by Jim Higson | June 9th, 2009 @ 07:56 PM | in 1.7

Using 1.61r2, this:

new Ajax.Request( http://example.com,

      { method    : 'head'
      });

sends a rubyesque post with _method=head. As far as I can tell, Prototype's Ajax does not allow sending of head requests. Head requests are useful. Sometimes you just want to know the last time something changed without actually downloading it.

A programmer might miss this - if you're just looking for headers you probably would never notice Prototype is actually sending a POST and fetching the full resource because the headers are still there.

Comments and changes to this ticket

  • Jim Higson

    Jim Higson June 18th, 2009 @ 11:17 AM

    • Tag changed from ajax to ajax, http, patch, patched

    Patch against 1.6.1rc3 - adds head support to Ajax.

  • P. Douglas Reeder

    P. Douglas Reeder June 18th, 2009 @ 04:33 PM

    I'd like to request that PUT and DELETE be implemented as well. They are essential for interfacing with REST-ful web services. As I understand the HTTP protocol, this wouldn't be complicated at all.

  • Tobie Langel

    Tobie Langel June 19th, 2009 @ 12:08 AM

    • State changed from “new” to “enhancement”
    • Milestone set to 1.7
  • Tobie Langel

    Tobie Langel June 19th, 2009 @ 12:09 AM

    There's a whole bunch of cross-browser issues to handle. If that was trivial, it would have been handled a long time ago. Planned for our 1.7 or 2.0 release, though.

  • Tobie Langel

    Tobie Langel June 19th, 2009 @ 01:13 PM

    I suggest you:

    1. start a thread on the core mailing list,
    2. link the LH ticket to it,
    3. have a look at the report for HEAD requests[1],
    4. provide similar reports for PUT, DELETE, etc.
    5. assess the issues switching system will cause for different back-ends (RoR, PHP, etc.),
    6. post a fully tested patch.

    [1] http://dev.rubyonrails.org/ticket/8645

    Hi,

    On lighthouse you said:

    There's a whole bunch of cross-browser issues to handle. If that was trivial, it would have been handled a long time ago. Planned for our 1.7 or 2.0 release, though.

    I've been searching Google for a while now looking for issues with XHR that relate to HEAD, DELETE, PUT requests but not GET, POST and haven't been able
    to find anything.

    I really need to do head requests for a project I'm working on that uses Prototype. Lookie:

    http://wikizzle.org/wikiz-nightly/?action=edit - only Moz at the moment :-(

    Getting the availability of the linked article is done via a HEAD request (looking at status 200/404). Fetching the whole wikitext just to see if the article's there is just too wasteful.

    Anyway, if you have a link etc describing the cross-browser thing that'd be really helpful. I could write something to handle the issues and submit
    another patch.

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 01:54 AM

    • Tag changed from ajax, http, patch, patched to patch, patched, section:ajax

    [not-tagged:"ajax" tagged:"section:ajax" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 02:28 AM

    • Tag changed from patch, patched, section:ajax to patched, section:ajax

    [not-tagged:"patch" tagged:"patched" bulk edit command]

  • Samuel Lebeau

    Samuel Lebeau August 26th, 2009 @ 08:12 AM

    • Assigned user set to “Samuel Lebeau”
  • T.J. Crowder

    T.J. Crowder November 16th, 2009 @ 04:50 PM

    • Assigned user cleared.

    [responsible:none bulk edit command]

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 Prototype JavaScript library.

Shared Ticket Bins

Attachments

Pages