Set a content-type header for json posts

This commit is contained in:
mmcwilliams 2017-11-21 16:59:22 -05:00
parent 5ea31a7050
commit a99f364fb9
1 changed files with 2 additions and 0 deletions

View File

@ -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)