Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#6477 closed enhancement (worksforme)

Add processData option to JQuery post

Reported by: aagrawal Owned by:
Priority: low Milestone:
Component: ajax Version: 1.4.2
Keywords: post, processData, request-body, ajaxrewrite Cc:
Blocked by: Blocking:

Description

It's common for web services to expect data to be POSTed in the request body and not as URL parameters. This cannot be done via $.post right now, so you have to resort to using $.ajax with type 'POST'.

This option should be added to $.post

Change History (5)

comment:1 Changed 13 years ago by dmethvin

Component: unfiledajax

comment:2 Changed 13 years ago by Rick Waldron

Keywords: post processData request-body added
Milestone: 1.4.3
Priority: low
Status: newopen

See: http://api.jquery.com/jquery.ajax/ Find: processData

This might be a useful feature to extend to the $.post() shorthand

comment:3 Changed 13 years ago by Rick Waldron

Keywords: ajaxrewrite added

comment:4 Changed 13 years ago by jaubourg

Maybe there's something I don't get but there is no correlation between appending data to the url and processData. ProcessData only indicates the data needs to be url-encoded IF and WHEN it is not a string. If you pass a string to $.post() as your data parameter then it WILL be sent in the request body. Are we sure we're not dealing with a request that cannot be dealt with using a POST and hence end up being dealed with as a GET (cross-domain jsonp & script notably).

comment:5 Changed 12 years ago by john

Resolution: worksforme
Status: openclosed

Yeah, this is quite confusing - if a POST is happening then it should be in the post body, please create a new ticket with a test case if this is not the case.

Note: See TracTickets for help on using tickets.