알쓸전컴(알아두면 쓸모있는 전자 컴퓨터)
axios post 에 params 데이터 보내기 본문
post 에 params 데이터 보내기
Get 방식의 경우에는
axios.get('/user', { params: { ID: 12345 } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });
위와 같이 보내면 되지만
Post 는 안됩니다.
npm install url-search-params-polyfill --save 로 설치를 하고 이유는 IE 11 을 커버 하기 위해서 입니다.
<script>
import 'url-search-params-polyfill';
을 추가 해 줍니다.
var params = new URLSearchParams();
params.append('doc_number', this.no);
params.append('doc_password', this.doc_password);
axios.post('/W_Server/suggestion_board_delete'
,params)
.then((Resopnse) => {
}).catch((ex)=>{
console.log(ex);
})
위와 같이 보내면 parmas 을 보낼수 있습니다.
'Web > Vue js tip' 카테고리의 다른 글
javascirpt Input 입력폼 엔터키 누를 경우 Submit 막기 (0) | 2018.03.13 |
---|---|
CKEDITOR 가끔씩 내용이 비어 있어을때 . (0) | 2018.03.13 |
vue2-datatable select multi check box 상태 유지 하기 (0) | 2018.03.04 |
drag and drop 파일 업로더 (vue-simple-uploader) (0) | 2018.03.03 |
vue js ckeditor 적용법 (4) | 2018.03.01 |
Comments