Accept header not working
I have to call for an web service which requires a Accept header and then it returns a json result. I test the service with "Postman" and got the response succesfully.but its not working when trying to do programatically
- $(document).ready(function () {
-
- var xhr = new XMLHttpRequest();
- $.ajax({
- url: 'http://102.22.169.113:9763/services/charaka_DataService/select_all_configs_operation?config_key=MAX',
- type: 'GET',
- dataType: 'json',
- accept: {
- json: 'application/json/salaya'
- },
- cache: false,
- success: function (data) {
- alert(data);
- },
- error: function (xhr, errorType, exception) {
- alert('request failed :' + exception);
- }
- });
- });