alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.77k stars 361 forks source link

ajax post return 415 (unsupported media type) #240

Closed dougucb closed 8 years ago

dougucb commented 8 years ago

Hi:

I'm trying to do an ajax post within the datatable dataset, and what I get back is a 415 error. I believe this is either because the headers aren't set, or I'm missing a parameter. In any case, my dataset object looks like this:

dataset: { ajax: true, ajaxUrl: 'http://localhost:8080/totally/valid/url', ajaxMethod: 'POST', ajaxData: { "eggs" : sunny_side_up }, ajaxDataType: 'json', records: [], perPageDefault: 5, perPageOptions: [5, 10, 15] },

Any pointers towards a possible solution would be appreciated. Thanks.

dougucb commented 8 years ago

There are of course simple workarounds; I just wanted to do it as part of the table definition ajax, and I couldn't find a way to make this work. I'm just going with the workaround now.