Loading...
2023. 5. 3. 02:31

front에서 데이터를 제대로 보냈는데 fastapi에서 422 unprocessable entity 에러 나는 경우

1. 422 unprocessable entity front에서 axios로 back(fastapi)으로 데이터 요청을 보낼때, 볼 수 있는 에러 vue.js에서 title과 keyword를 text로 입력받고.. //vue.js 자동 작성 //중간 생략 async createAIReview () { axios .post(`http://127.0.0.1:8000/reviews/gpt`, { title: this.form.title, keyword: this.form.keyword, writer: this.form.writer, char: this.form.char }) .then(result => { console.log(result) this.form.content = result.review this..

2023. 1. 31. 00:38

react & node.js 개발 -get요청으로 서버에 데이터 보내는 방법

get요청으로 단순히 다음과 같이 데이터를 보내면.. 서버가 데이터를 받지 못한다 //client const data = {id:state}; const response = await axios.get('/get/one',data) 서버에서 다음과 같이 data를 받아본다면... //server.js app.get('/get/one', (req,res) => { console.log(req.body) }) data를 받을 것으로 기대되는데 실제로 아무것도 찍히지 않는다 get요청으로 데이터를 보낼때는, get요청이 post와는 다르게 주소창을 통해서 데이터를 보내기 때문에 params라는 옵션으로 다음과 같이 데이터를 보내줘야한다고 한다 //client const response = await axios..