## Github URL : https://github.com/leewoopyo/TestApiClient
GitHub - leewoopyo/TestApiClient
Contribute to leewoopyo/TestApiClient development by creating an account on GitHub.
github.com
1. 소스코드
TestApiClient.html
<!DOCTYPE html>
<html>
<body>
<button onclick="callApi()">클릭</button>
<div id="show_result"></div>
<script>
function callApi() {
//Header
const config = {
method: "get"
};
//Call Api
fetch("http://localhost:19001/verification/api/info/java-version", config)
.then(response => response.json())
.then(data => {
console.log(data);
const div_data = document.createElement("div");
const show_result = document.getElementById("show_result");
div_data.textContent = JSON.stringify(data);
show_result.appendChild(div_data);
})
.catch(error => console.log(error));
}
</script>
</body>
</html>
'html,css,js' 카테고리의 다른 글
mouseover 시 slide 애니메이션을 가진 메뉴바 (0) | 2020.02.12 |
---|