[React]
const config = {
headers : {
'Accept' : 'application/json'
}
}
fetch(`http://localhost:8086/piece?piece=${piece}`, config)
.then((res) => res.text())
.then((data) => {
console.log(data)
numbers = data.split(',')
})
fetch 결과가 String일 경우, res.json()이 아니라 res.text()로 처리해야한다.