Opened 12 years ago
Closed 12 years ago
#8106 closed bug (wontfix)
ajaxSetup instantiated contentType not included when no data is sent
Reported by: | Owned by: | jaubourg | |
---|---|---|---|
Priority: | blocker | Milestone: | 1.next |
Component: | ajax | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Perhaps this was done purposely, but this is a change to the method.
Change History (4)
comment:1 Changed 12 years ago by
Component: | unfiled → ajax |
---|---|
Owner: | set to jaubourg |
Priority: | undecided → blocker |
Status: | new → assigned |
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
This is the specific case where I'm having an issue. Maybe this is just an issue with $.post():
jQuery 1.4.3-1.4.4 will apply the contentType, other versions do not (so maybe this was never meant to happen?)
comment:4 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Correct - this behaviour was actually a bug in 1.4.2/3. The method to force content-type as jitter explains is the only way.
Note: See
TracTickets for help on using
tickets.
I think this is only a little wording problem in the documentation. The jQuery.ajax() documentation says:
These two test cases show that the documentation has to be taken literal.
test case works as expected because
contentType
is passed directly tojQuery.ajax(...)
This test case doesn't send the
content-type
header when there is no data as thecontentType
setting wasn't passed "directly" tojQuery.ajax(...)
So the documentation needs to be taken literal. Only if you pass the
contentType
option directly to$.ajax(...)
it gets send even when there is no data.