Content-Type
헤더와 일치해야 한다.JSON.stringify()
메서드를 적용하지 않았을 때 400오류가 발생했다.const thumbnailRes = await fetch(
`http://localhost:5050/analysis/thumbnail`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
// JSON.stringify 안하면 400오류
body: JSON.stringify({ url: analysis.videoPath }),
}
);
JSON.stringify()
메서드는 JavaScript 값이나 객체를 JSON 문자열로 변환한다.