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, tunerChannelId: channelId,
providerChannelId: providerChannelId providerChannelId: providerChannelId
}), }),
contentType: 'application/json',
dataType: 'json' dataType: 'json'
}).then(mapping => { }).then(mapping => {
const listItem = dom.parentWithClass(button, 'listItem'); const listItem = dom.parentWithClass(button, 'listItem');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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