Set a content-type header for json posts
This commit is contained in:
parent
5ea31a7050
commit
a99f364fb9
|
@ -392,6 +392,7 @@
|
||||||
<script>
|
<script>
|
||||||
'use strict'
|
'use strict'
|
||||||
const web = {};
|
const web = {};
|
||||||
|
web._header = new Headers({ 'content-type' : 'application/json' })
|
||||||
web.frame = function () {
|
web.frame = function () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method : 'POST',
|
method : 'POST',
|
||||||
|
@ -414,6 +415,7 @@
|
||||||
console.log('set to => ' + dir)
|
console.log('set to => ' + dir)
|
||||||
const opts = {
|
const opts = {
|
||||||
method : 'POST',
|
method : 'POST',
|
||||||
|
headers : web._header,
|
||||||
body : JSON.stringify({ dir : dir })
|
body : JSON.stringify({ dir : dir })
|
||||||
};
|
};
|
||||||
console.dir(opts)
|
console.dir(opts)
|
||||||
|
|
Loading…
Reference in New Issue