DOMDOM
0posts
today
total
personal posts · since 2021

Fragments
of a day.

A small notebook for slow moments slipping by.

2023 IT Creator
2024 Food Creator
2025 News Creator
2026 News Creator

Latest Posts최근

tistory view

Back to Home

크롬브라우저 개발자도구에서 POST로 API 호출하는 방법

728x90
반응형

 

크롬브라우저 개발자도구에서 POST로 API 호출하는 방법

// 전달할 데이터 포맷을 설정합니다 
// 데이터 설정 예시
const formData = new FormData();
formData.append('id', 2);  
formData.append('mode', 'insert');  
formData.append('page', 1);  
formData.append('etc', null);


// POST로 API 호출
fetch('{API URL 작성}', {
  method: 'POST',
  body: formData
})
  .then(response => response.text())  
  .then(data => console.log(data)) 
  .catch(error => console.error('Error:', error));

 

 

 

 

 

콘솔창에서 결과값을 확인하면 끝!

 

 

728x90
반응형

Comments

Thanks for staying up late.

keep wandering · keep listening