Ticket #6549 (closed enhancement: worksforme)
AJAX calls should set the "Accept" header if appropriate
|Reported by:||MikeBaranczak||Owned by:|
|Keywords:||ajax header json||Cc:|
Some web service libraries (like Jersey) allow you to send back data in different formats (like XML, JSON or www-form-encoded) from the same URL. The client can select the format by setting the "Accept" request header. This unfortunately can't be done through JQuery.
I propose the following enhancements:
- Allow the "Accept" header to be set when calling $.ajax();
- Make $.getJSON() (and possibly other high-level AJAX calls) set this header to the appropriate value by default.
(See the comment by Wolfram Arnold on this page: http://api.jquery.com/jQuery.getJSON/ )
comment:4 Changed 5 years ago by snover
- Milestone 1.4.3 deleted