Add application/json as content type for JSON requests

This commit is contained in:
Claus Vium 2020-08-31 15:48:24 +02:00
parent 77ce9f1088
commit 8dcbacb196
8 changed files with 15 additions and 7 deletions

View File

@ -24,6 +24,7 @@ export default class channelMapper {
tunerChannelId: channelId,
providerChannelId: providerChannelId
}),
contentType: 'application/json',
dataType: 'json'
}).then(mapping => {
const listItem = dom.parentWithClass(button, 'listItem');

View File

@ -169,7 +169,8 @@ import 'emby-button';
data: JSON.stringify({
ValidateWriteable: validateWriteable,
Path: path
})
}),
contentType: 'application/json'
}).catch(response => {
if (response) {
if (response.status === 404) {

View File

@ -48,7 +48,8 @@ import libraryMenu from 'libraryMenu';
data: JSON.stringify({
Path: form.querySelector('.txtEncoderPath').value,
PathType: 'Custom'
})
}),
contentType: 'application/json'
}).then(Dashboard.processServerConfigurationUpdateResult, onSaveEncodingPathFailure);
});
}

View File

@ -31,7 +31,8 @@ import globalize from 'globalize';
dataType: 'json',
data: JSON.stringify({
Pin: view.querySelector('#txtPin').value
})
}),
contentType: 'application/json'
}).then(processForgotPasswordResult);
e.preventDefault();
return false;

View File

@ -12,7 +12,8 @@ function save(page) {
apiClient.ajax({
type: 'POST',
data: JSON.stringify(config),
url: apiClient.getUrl('Startup/RemoteAccess')
url: apiClient.getUrl('Startup/RemoteAccess'),
contentType: 'application/json'
}).then(function () {
loading.hide();
navigateToNextPage();

View File

@ -12,7 +12,8 @@ function save(page) {
apiClient.ajax({
type: 'POST',
data: JSON.stringify(config),
url: apiClient.getUrl('Startup/Configuration')
url: apiClient.getUrl('Startup/Configuration'),
contentType: 'application/json',
}).then(function () {
loading.hide();
navigateToNextPage();

View File

@ -18,7 +18,8 @@ function save(page) {
apiClient.ajax({
type: 'POST',
data: JSON.stringify(config),
url: apiClient.getUrl('Startup/Configuration')
url: apiClient.getUrl('Startup/Configuration'),
contentType: 'application/json'
}).then(function () {
Dashboard.navigate('wizarduser.html');
});

View File

@ -27,7 +27,8 @@ function submit(form) {
Name: form.querySelector('#txtUsername').value,
Password: form.querySelector('#txtManualPassword').value
}),
url: apiClient.getUrl('Startup/User')
url: apiClient.getUrl('Startup/User'),
contentType: 'application/json'
}).then(onUpdateUserComplete);
}