ajax 썸네일형 리스트형 Add authorization header in ajax with axios Add authorization header in ajax process. const token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MvXC9yZW5ld9fQ.hGyUlcvaRfLhiaaQAqQg'; const authorization = `JWT ${token}`; axios.defaults.headers.common["authorization"] = authorization; const authCodeResult = await axios.post() 더보기 Force file download Force download with axios on vue.js fileDownload = (url, method, req, fileName) => { const axiosConfig = { method: method, url: url, responseType: 'blob', params: req, }; try { const response = await axios(axiosConfig); const url = window.URL.createObjectURL(new Blob([response.data])); const anchor = document.createElement('a'); anchor.href = url; anchor.setAttribute('download', fileName); docum.. 더보기 [JavaScript] Post 날리기 꼼수긴 하지만 아래와같이 해주면 post를 날려줄 수 있음. doPost: function(url, params){ var form = $("").attr("action", url); $.each(params, function(name, value){ $("").attr("name", name).attr("value", value).appendTo(form); }); form.appendTo("body"); form.submit(); }, 더보기 이전 1 다음