Skip to main content

Bug Tracker

Side navigation

#9757 closed bug (wontfix)

Opened July 06, 2011 12:14PM UTC

Closed July 11, 2011 11:43PM UTC


Reported by: anonymous Owned by:
Priority: undecided Milestone:
Component: ajax Version: 1.6.2
Keywords: Cc: jaubourg
Blocked by: Blocking:

When you use object for your data in an ajax request and want to add more data to this object with "ajaxPrefilter", it does not work, is converted in an url encoded string.

It is better to use an object type for "".

Attachments (0)
Change History (3)

Changed July 11, 2011 08:23PM UTC by addyosmani comment:1

cc: → jaubourg

Changed July 11, 2011 09:46PM UTC by ajpiano comment:2

component: unfiledajax


Is this something we should fix or is it intended behaviour?

Changed July 11, 2011 11:43PM UTC by jaubourg comment:3

resolution: → wontfix
status: newclosed

It is intended behaviour. A string can be passed as data, so decision was taken to serialize non-string data so that a prefilter always has the same "presentation" of the data option.

Relying on data not being a string is wrong and will result in programming errors seeing as a user is perfectly entitled to call ajax with data as a string.

I know it sucks since it means more work in the prefilters to add data in but that's the price to pay for consistency: your prefilter should work with being a string anyway.