-
Notifications
You must be signed in to change notification settings - Fork 1
/
2-2-4-fetch.html
72 lines (63 loc) · 2.71 KB
/
2-2-4-fetch.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>FDS Node.js + HTTP</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/blood.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match(/print-pdf/gi) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName('head')[0].appendChild(link);
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>Fetch API</h1>
</section>
<section>
<h1>Fetch API</h1>
<ul>
<li>웹 브라우저의 <strong>XMLHttpRequest를 대체</strong>하기 위해 만들어진 새로운 HTTP client 표준</li>
<li>비교적 최근에 도입되어 IE 및 구형 안드로이드 브라우저(4.x)는 지원하지 않음</li>
<li><a href="https://github.com/github/fetch">Fetch Polyfill</a></li>
<li><a href="https://www.npmjs.com/package/isomorphic-fetch">isomorphic-fetch</a></li>
</ul>
</section>
<section>
<h1>Axios vs Fetch API</h1>
<ul>
<li>Axios는 여러 <strong>편의기능</strong>(instance와 같이 설정을 재사용하거나 요청중인 연결을 취소하는 등)을 제공</li>
<li>다만, Axios는 내부적으로 XMLHttpRequest를 사용하고 있는데 <strong>Service Worker 등의 최신 기술이 XMLHttpRequest를 지원하지 않으므로,</strong> Service Worker를 사용할 예정에 있는 프로젝트에서는 Axios 대신 Fetch API를 사용해야만 함</li>
</ul>
</section>
<section>
<p><a href="http://hacks.mozilla.or.kr/2015/05/this-api-is-so-fetching/">정말 멋진 Fetch API</a></p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function () { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>