js fetch ํ, response ์๋ต์ด ๋๋ฆฐ ๋ฌธ์
๋ฌธ์ let url = `${TSP_SVR_URL}/fix_points`; fetch(url, { method: "POST", headers: { "Content-type": "applicaion/json", }, body: JSON.stringify({ SPoint: pointList[0], EPoint: pointList[0], SPointList:{ nodes:pointList.slice(1, cnt) }, }), }) .then(response => response.json()) .then(body => { console.log(body) }); fetch ์์ฒญ ์์ response์ body๊ฐ ๋๋ฌด ๋ฆ๊ฒ ์ค๋ ํ์์ด์๋ค. ํ๋ฆฌํ๋ผ์ดํธ๊ฐ ์ ์ผ ๋จผ์ ์ค๊ณ , ๊ทธ๋ค์ fetch response๊ฐ ๋ค์ด์ค..
2022. 4. 29.