Bug Tracker

Opened 12 years ago

Closed 12 years ago

#9508 closed enhancement (wontfix)

Allow RESTful requests with JSON-P by adding the request type as parameter

Reported by: [email protected] Owned by:
Priority: low Milestone: 1.next
Component: ajax Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:


Currently it is not possible to call a REST API with JSON-P because the requests are always GET requests. But when an API already implemented this JSON-P hack to work at all via JSON-P then it would also be nice when the request type could be submitted with a special request parameter, too, so REST services could check this parameter in addition to the real HTTP method.


jQuery.ajax(url, { type: "DELETE", dataType: "jsonp" });

This should result in a GET request with these request parameters:


I'm not sure if "_method" is a good parameter name but I've already seen multiple REST tutorials/articles which used this parameter name for calling PUT/DELETE URLs without Ajax in a browser.

Change History (1)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfiledajax
Priority: undecidedlow
Resolution: wontfix
Status: newclosed

This can be implemented by using an ajaxPrefilter:


Note: See TracTickets for help on using tickets.