반응형
- GET은 params에 담아서 보내면 그대로 읽어오지만 post로 보내니까 값을 못받아온다.
get :
getDetail(row){
const params = {
bno : row.bno
}
axios
.post('/getDetail', params)
.then((response) => {
if(response.data){
this.boardDetail = response.data;
}
})
.catch(function(error){
console.log(error);
})
}
post :
400 ) Required requst parameter 'bno' for method parameter type int is not present
npm install url-search-params-polyfill --save 설치
import 'url-search-params-polyfill';
getDetail(row){
var params = new URLSearchParams();
params.append('bno', row.bno);
axios
.post('/getDetail', params)
.then((response) => {
if(response.data){
this.boardDetail = response.data;
}
})
.catch(function(error){
console.log(error);
})
잘 가져와진댜
반응형
'오류' 카테고리의 다른 글
java.sql.SQLRecoverableException: IO 오류: The Network Adapter could not establish the connection (0) | 2023.05.09 |
---|---|
ConcurrentModificationException : null (0) | 2023.05.08 |
vue cli 설치오류 (0) | 2023.04.20 |
ajax success 안탐 (0) | 2023.02.28 |
Ajax return string 404에러 (0) | 2023.02.28 |