Bug Tracker

Modify

Ticket #6477 (closed enhancement: worksforme)

Opened 3 years ago

Last modified 15 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 years ago by dmethvin

  • Component changed from unfiled to ajax

comment:2 Changed 3 years ago by rwaldron

  • Keywords post processData request-body added
  • Priority set to low
  • Status changed from new to open
  • Milestone 1.4.3 deleted

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

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

comment:3 Changed 2 years ago by rwaldron

  • Keywords post,processData,request-body,ajaxrewrite added; post processData request-body removed

comment:4 Changed 2 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 2 years ago by john

  • Status changed from open to closed
  • Resolution set to worksforme

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.