<post, get 메서드 정하는 법>
<post 메서드 코드>
async function fetchData() {
try {
const res = await axios.post('http://127.0.0.1:8080/coordinator/profile',
{
coordinator_id: 1,
nickname: nickname,
sns_url: sns_url,
image_url: image_url,
content: content,
gender: male === true ? 'MALE' : 'FEMALE',
height: height,
weight: weight,
total_like: 0,
request_count: 0
},
{
headers: { 'Content-Type': 'application/json'},
}
);
console.log(res);
} catch (error) {
console.error(error);
}
}
async
await