We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb4c827 commit eab5cccCopy full SHA for eab5ccc
src/BootstrapBlazor/wwwroot/modules/ajax.js
@@ -20,9 +20,12 @@
20
headers['Content-Type'] = 'application/json; charset=utf-8'
21
}
22
const contentType = headers['Content-Type'];
23
- let postData = JSON.stringify(data);
24
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
25
- postData = new URLSearchParams(data).toString();
+ let postData = null;
+ if (data) {
+ postData = JSON.stringify(data);
26
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
27
+ postData = new URLSearchParams(data).toString();
28
+ }
29
30
result = await fetch(url, {
31
method: method,
0 commit comments