Skip to content

Commit f5cceb8

Browse files
committed
Send JSON data in Ajax requests
1 parent e9fe7b9 commit f5cceb8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

dist/js/datatables-factory.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2654,7 +2654,8 @@ Loader.class_methods = {
26542654
return $.ajax({
26552655
url: url,
26562656
type: 'POST',
2657-
data: data,
2657+
data: JSON.stringify(data),
2658+
contentType: 'application/json',
26582659
statusCode: {
26592660
422: function _() {
26602661
alert("Votre session a expiré, veuillez vous reconnecter.");

src/modules/loader.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Loader.class_methods =
1515
$.ajax
1616
url: url
1717
type: 'POST'
18-
data: data
18+
data: JSON.stringify(data)
19+
contentType: 'application/json'
1920
statusCode:
2021
422: ->
2122
alert "Votre session a expiré, veuillez vous reconnecter."

0 commit comments

Comments
 (0)