Skip to main content

Bug Tracker

Side navigation

#3818 closed bug (worksforme)

Opened January 09, 2009 05:37PM UTC

Closed October 25, 2010 12:13AM UTC

Last modified March 14, 2012 01:22PM UTC

$.ajax() requires data param if type is POST

Reported by: ibrahim Owned by:
Priority: minor Milestone: 1.3
Component: ajax Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:

if i didn't set data option in $.ajax(); with type : "POST" the request will fail.

$('a').click(function () {


url: $(this).attr('href'),

type: 'POST',

// data: '',

success: function(data) { $('div').html(data); }


return false;


Attachments (1)
  • error.jpg (15.2 KB) - added by ibrahim January 09, 2009 05:38PM UTC.
Change History (3)

Changed January 15, 2009 04:18AM UTC by dmethvin comment:1

summary: Problem with $.ajax();$.ajax() requires data param if type is POST

So if data is not supplied, you would want a POST with Content-length 0?

Changed February 15, 2009 06:09PM UTC by dmethvin comment:2

Could you provide some feedback on the expected behavior? Although jQuery could set content-length=0 and do the POST, it seems like omitting the data parameter is most likely an error in the caller's code.

Changed October 25, 2010 12:13AM UTC by rwaldron comment:3

resolution: → worksforme
status: newclosed

This issue appears to be no longer existent

The ticket may be reopened if a new test case showing the broken behavior is submitted.