Bug Tracker

Modify

Ticket #11134 (closed bug: wontfix)

Opened 2 years ago

Last modified 2 years ago

$.post doesn't allow setting a contentType

Reported by: iwein Owned by:
Priority: low Milestone: None
Component: traversing Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

When posting json to a server you need to set the content type. This can not be done with the $post short-hand, and therefore requires fallback to $.ajax.

It would be great if $.post also supported a contentType.

Sample code:  http://jsfiddle.net/bNA8T/

See  http://stackoverflow.com/questions/8757681/why-does-jquery-post-json-as-a-parameter-name-instead-of-as-the-request-body for details and some more code.

Change History

comment:1 Changed 2 years ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to wontfix
  • Status changed from new to closed
  • Component changed from unfiled to traversing

If you want finer control, use $.ajax.

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.