{"id":283,"date":"2026-06-26T13:34:12","date_gmt":"2026-06-26T13:34:12","guid":{"rendered":"https:\/\/aabbee.cafe24.com\/?p=283"},"modified":"2026-06-26T14:02:46","modified_gmt":"2026-06-26T14:02:46","slug":"xmlhttprequest-%eb%b6%80%ed%84%b0axios-%ea%b9%8c%ec%a7%80","status":"publish","type":"post","link":"https:\/\/coalacoding.com\/?p=283","title":{"rendered":"xmlhttprequest-\ubd80\ud130axios-\uae4c\uc9c0"},"content":{"rendered":"<p>XMLHttpRequest<a href=\"https:\/\/www.mockaroo.com\/\">https:\/\/www.mockaroo.com\/<\/a> <\/p>\n<h2>1. XMLHttpRequest<\/h2>\n<pre><code class=\"language-javascript\">let request = new XMLHttpRequest(); \/\/\ud1b5\uc2e0\uac1d\uccb4\uc0dd\uc131\nconst url = &quot;.\/MOCK_DATA.json&quot;; \/\/\uc11c\ubc84\uc8fc\uc18c\uc124\uc815\n\/\/\uc751\ub2f5\uc0c1\ud0dc\ubcc4 \ucc98\ub9ac\nrequest.onreadystatechange = function () {\n  if (request.readyState == 4 &amp;&amp; request.status == 200) {\n    jsonfunc(this.responseText);\n  }\n};\n\/\/\ud1b5\uc2e0 \ubc29\uc2dd\uacfc \uc8fc\uc18c .open(&quot;GET&quot;, url) , \ud68c\uc120\uc5f0\uacb0\nrequest.open(&quot;GET&quot;, url);\n\/\/\ud1b5\uc2e0\uc2e4\ud589\nrequest.send();\n\n\/\/\ub124\ud2b8\uc6cc\ud06c \ud1b5\uc2e0\uc73c\ub85c db \ubc1b\uae30\n\/\/\ubc1b\uc740 db\ub97c \uac00\uacf5\ud574\uc11c \ud654\uba74\uc5d0 \ubc14\uc778\ub529\nfunction jsonfunc(responseText) {\n  let id = new Array();\n  let first_name = new Array();\n  let last_name = new Array();\n  let email = new Array();\n  let gender = new Array();\n  let ip_address = new Array();\n\n  \/\/json \ub370\uc774\ud130\ub97c text\ub85c \ubcc0\ud658\n  let jsonTxt = JSON.parse(responseText);\n  \/\/dom \uc694\uc18c \uc900\ube44\n  const wrap = document.querySelector(&quot;.wrap&quot;);\n  \/\/table \ud0dc\uadf8\uc0dd\uc131 .createElement\n  let table = document.createElement(&quot;table&quot;);\n  \/\/\ubc18\ubcf5\ubb38\uc0ac\uc6a9\ud574\uc11c \ub370\uc774\ud130 \ubc14\uc778\ub529\n  for (i = 0; i &lt; jsonTxt.length; i++) {\n    id[i] = jsonTxt[i].id;\n    first_name[i] = jsonTxt[i].first_name;\n    gender[i] = jsonTxt[i].gender;\n    last_name[i] = jsonTxt[i].last_name;\n    email[i] = jsonTxt[i].email;\n    \/\/tr,td \uc0dd\uc131\ud6c4 \ub370\uc774\ud130 \ub123\uae30\n    let tr = document.createElement(&quot;tr&quot;);\n    let td1 = document.createElement(&quot;td&quot;);\n    td1.appendChild(document.createTextNode(id[i] + &quot;&quot;));\n    let td2 = document.createElement(&quot;td&quot;);\n    td2.appendChild(document.createTextNode(first_name[i] + &quot;&quot;));\n    let td3 = document.createElement(&quot;td&quot;);\n    td3.appendChild(document.createTextNode(gender[i] + &quot;&quot;));\n    let td4 = document.createElement(&quot;td&quot;);\n    td4.appendChild(document.createTextNode(last_name[i] + &quot;&quot;));\n    let td5 = document.createElement(&quot;td&quot;);\n    td5.appendChild(document.createTextNode(email[i] + &quot;&quot;));\n    tr.appendChild(td1);\n    tr.appendChild(td2);\n    tr.appendChild(td3);\n    tr.appendChild(td4);\n    tr.appendChild(td5);\n    table.appendChild(tr);\n  }\n  wrap.appendChild(table);\n}\n<\/code><\/pre>\n<h2>1. Fetch \uc2dc\uc791\ud558\uae30<\/h2>\n<h3>1.1 Fetch \ub4f1\uc7a5 \ubc30\uacbd<\/h3>\n<p>Fetch \uc0ac\uc6a9 \uc774\uc720\uc5d0 \ub300\ud574 \uc54c\uae30 \uc704\ud574\uc11c\ub294 \ube44\ub3d9\uae30\ud1b5\uc2e0\uc758 \uc5ed\uc0ac\uc5d0 \ub300\ud574 \uac04\ub7b5\ud558\uac8c \uc54c\uace0 \ub118\uc5b4\uac08 \ud544\uc694\uac00 \uc788\ub2e4. Fetch\uac00 \ub098\uc624\uae30 \uc804\uae4c\uc9c0\ub294 JS\uc5d0\uc11c Ajax\ub97c \uc0ac\uc6a9\ud558\uae30\ub294 \uad49\uc7a5\ud788 \ubc88\uac70\ub85c\uc6e0\ub2e4. XMLHttpRequest API(\uc774\ud558 XHR)\ub97c \uc0ac\uc6a9\ud558\uc5ec XML \ub370\uc774\ud130\ub97c \uc8fc\uace0\ubc1b\uc558\ub294\ub370 \ucf54\ub4dc\uac00 \ubcf5\uc7a1\ud574 \uac00\ub3c5\uc131\ub3c4 \ub5a8\uc5b4\uc9c0\uace0 \uc11c\ubc84\uc758 \ub3d9\uc791\uc744 \ud30c\uc545\ud558\uae30 \ud798\ub4e4\uc5c8\ub2e4. \uc774\ub7ec\ud55c \ubd88\ud3b8\ud568\uc744 \ud574\uc18c\ud558\uae30 \uc704\ud574 Fetch API\uac00 ES6\ubd80\ud130 \ub4f1\uc7a5\ud558\uba70 XHR\ub97c \uc0ac\uc6a9\ud558\ub358 \ubc29\uc2dd\ubcf4\ub2e4 \uc9c1\uad00\uc801\uc774\uba70 \uac00\ub3c5\uc131\uc774 \ub354\uc6b1 \uc88b\uc544\uc9c0\uac8c \ub418\uc5c8\ub2e4.<\/p>\n<h3>1.2 Fetch \uc0ac\uc6a9 \uc774\uc720<\/h3>\n<p>Fetch\ub294 \ub124\ud2b8\uc6cc\ud06c \ud1b5\uc2e0\uc744 \ud3ec\ud568\ud55c \ub9ac\uc18c\uc2a4\ub97c \uac00\uc9c0\uace0 \uc624\uae30 \uc704\ud55c \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc81c\uacf5\ud574 \uc8fc\ub294 API\uc774\ub2e4. XHR\uacfc \uae30\ub2a5\uc740 \uac19\uc9c0\ub9cc \ud655\uc7a5 \uac00\ub2a5\ud558\uba70 \ud6a8\uacfc\uc801\uc73c\ub85c \uad6c\uc131\ub418\uc5b4 \uc788\uace0,[1] \ub0b4\uc7a5\uae30\ub2a5\uc774\ub77c \ub77c\uc774\ube0c\ub7ec\ub9ac \uc5c5\ub370\uc774\ud2b8\uc5d0 \ub530\ub978 \uc5d0\ub7ec\ub97c \uac71\uc815\ud558\uc9c0 \uc54a\uc544\ub3c4 \ub41c\ub2e4.<\/p>\n<h2>2. Fetch \ubb38\ubc95<\/h2>\n<h3>2.1 Response \ud504\ub85c\ud37c\ud2f0\uc640 \uba54\uc11c\ub4dc<\/h3>\n<h4>2.1.1 Response \ud504\ub85c\ud37c\ud2f0\uc640 \uba54\uc11c\ub4dc\ub97c \uc124\uba85\ud558\uae30 \uc55e\uc120 \uac04\ub7b5\ud55c promise \uc124\uba85 \uc608\uc81c<\/h4>\n<pre><code class=\"language-javascript\">let promise = fetch(&#39;\uc5f0\uc2b5 url&#39;)\n\nconsole.log(promise)\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/01-18.png\" alt=\"\"><\/p>\n<p>Promise\ub294 \uc55e\uc5d0\uc11c \uc0b4\ud3b4 \ubd24\ub4ef\uc774 fetch\ub97c \uc0ac\uc6a9\ud588\uc744 \ub54c \uc2e4\ud589 \uacb0\uacfc\uc5d0 \ub300\ud55c \uc0c1\ud0dc\ub97c \ubc18\ud658\ud574 \uc8fc\ub294 \uc57d\uc18d\ub41c \uac1d\uccb4\uc774\ub2e4. Promise\uc5d0\ub294 3\uac00\uc9c0 \uc0c1\ud0dc <code>pending<\/code>, <code>fulfilled<\/code>, <code>reject<\/code>\uac00 \uc874\uc7ac\ud55c\ub2e4. <code>pending<\/code>\uc740 \uc9c4\ud589 \uc911, <code>fullfilled<\/code>\ub294 \uc644\ub8cc, <code>rejected<\/code>\ub294 \uc2e4\ud328\ub97c \uc758\ubbf8\ud55c\ub2e4. \uc704 console \ucc3d\uc744 \ud655\uc778\ud574 \ubcf4\uba74 PromiseState\uc758 \uc0c1\ud0dc\ub294 <code>fullfilled<\/code>, fetch\ub97c \ud574\uc624\ub294 \uac83\uc5d0 \uc131\uacf5\ud55c \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n<h4>2.1.2 Response \ud504\ub85c\ud37c\ud2f0\uc640 \uba54\uc11c\ub4dc\ub97c \uc124\uba85\ud558\uae30 \uc55e\uc120 \uac04\ub7b5\ud55c then \ud568\uc218 \uc124\uba85 \uc608\uc81c<\/h4>\n<pre><code class=\"language-javascript\">let promise = fetch(&quot;\uc5f0\uc2b5 URL&quot;).then(function (response) {\n    console.log(response);\n});\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/02-13.png\" alt=\"\"><\/p>\n<p>\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\ub294 <code>then()<\/code> \uba54\uc11c\ub4dc\ub97c \uc81c\uacf5\ud55c\ub2e4. <code>then()<\/code> \uba54\uc11c\ub4dc \uc548\uc5d0 \u2018\uc5f0\uc2b5 URL\u2019\uc758 \uc751\ub2f5\uac12\uc744 \ub2f4\uc744 \uc218 \uc788\ub294 \ucf5c\ubc31 \ud568\uc218\ub97c \ub9cc\ub4e4\uc5b4 \ub193\uace0 \uc815\uc0c1\uc801\uc73c\ub85c \uc751\ub2f5\uc774 \ub4e4\uc5b4\uc654\uc744 \uacbd\uc6b0 \uc751\ub2f5\uac12\uc744 \ucc98\ub9ac\ud560 \uc218 \uc788\ub2e4.<\/p>\n<h4>2.1.3 Response property\uc5d0 \ub300\ud55c \uc124\uba85\uacfc \uc608\uc81c<\/h4>\n<p>Response\ub294 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc758 \uac1d\uccb4\uc774\ub2e4. Response\ub294 \uc131\uacf5\uacfc \uc2e4\ud328\uc5d0 \ub300\ud55c \uc911\uc694\ud55c \uc815\ubcf4\ub97c \ub2f4\uace0 \uc788\ub2e4. \ubcf8\uaca9\uc801\uc73c\ub85c Response\uc758 \ud504\ub85c\ud37c\ud2f0\ub97c \uc54c\uc544\ubcf4\uc790.<\/p>\n<ul>\n<li>Response.body &#8211; \uc77d\uc744 \uc218 \uc788\ub294 \uc2a4\ud2b8\ub9bc\uc758 \ub0b4\uc6a9\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/li>\n<li>Response.bodyUsed &#8211; Response.body \ub0b4\uc6a9\uc744 \uc77d\uc5c8\ub294\uc9c0\ub97c \ud655\uc778\ud558\ub294 boolean \uac12\uc774\ub2e4. 2.1.2 \uc608\uc81c\uc5d0\uc11c\ub294 \uc5f0\uc2b5\uc758 body \ub0b4\uc6a9\uc744 \uc77d\uc9c0 \ubabb\ud588\uc9c0\ub9cc 2.1.3 \uc608\uc81c\uc5d0\uc11c\ub294 blob()\uc774\ub77c\ub294 \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud574 true\uc758 \uac12\uc774 \ubc18\ud658\ub418\ub294 \uac83\uc744 \ubcfc \uc218 \uc788\ub2e4. blob() \uba54\uc11c\ub4dc\ub294 \uc2a4\ud2b8\ub9bc\uc744 \uac00\uc838\uc640 \uc644\ub8cc\ud560 \ub54c\uae4c\uc9c0 \uc77d\uc5b4 \ubc18\ud658\ud558\ub294 \uba54\uc11c\ub4dc\uc774\ub2e4.<\/li>\n<\/ul>\n<pre><code class=\"language-javascript\">let promise = fetch(&quot;\uc5f0\uc2b5 url&quot;).then(function (response) {\n    console.log(response);\n    response.blob();\n});\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/03-11.png\" alt=\"\"><\/p>\n<ul>\n<li>Response.header &#8211; Response\uc640 \uc5f0\uacb0\ub41c headers\uc758 \uac1d\uccb4\uc774\ub2e4.<\/li>\n<li><strong>Response.ok<\/strong> &#8211; \uc751\ub2f5\uc774 \uc131\uacf5\ud588\ub294\uc9c0 \ubc94\uc704\uc758 \uc0c1\ud0dc \uc5ec\ubd80\ub97c \ub098\ud0c0\ub0b4\ub294 boolean \uac12\uc774\ub2e4. HTTP \uc0c1\ud0dc \ucf54\ub4dc\uac00 200~299 \uc0ac\uc774\uc77c \uacbd\uc6b0 true\ub97c \ub098\ud0c0\ub0b4\uace0 \uc751\ub2f5\uc774 \uc2e4\ud328\ud588\uc744 \uacbd\uc6b0 false\ub97c \ub098\ud0c0\ub0b8\ub2e4.<\/li>\n<li>Response.redirect &#8211; \uc751\ub2f5\uc774 \uc0c8 URL\ub85c \ub9ac\ub514\ub809\uc158\ud558\uace0 \uc0c8 URL\uc744 \uc9c0\uc815\ud558\uc600\ub294\uc9c0 \uc0c1\ud0dc \uc5ec\ubd80\ub97c \ub098\ud0c0\ub0b4\ub294 boolean \uac12\uc774\ub2e4.<\/li>\n<li><strong>Response.status<\/strong> &#8211; HTTP \uc0c1\ud0dc \ucf54\ub4dc\ub97c \uc758\ubbf8\ud55c\ub2e4. \uac12\uc740 \uc9e7\uc740 \uc22b\uc790\ub85c \uc124\uc815\ub418\uc5b4 \uc788\ub2e4. \ubc94\uc704\ub294 \uc544\ub798\uc640 \uac19\uc774 \ub418\uc5b4 \uc788\uc9c0\ub9cc \uc790\uc138\ud55c \uac83\uc740 [1]MDN \uacf5\uc2dd \ubb38\uc11c\uc640 HTTP\ud30c\ud2b8\uc758 \uc751\ub2f5 \ubd80\ubd84\uc744 \ucc38\uace0\ud558\uae38 \ubc14\ub780\ub2e4.\n<ol>\n<li>Informational responses (100-199)<\/li>\n<li>Successful responses (200-299)<\/li>\n<li>Redirection messages (300-399)<\/li>\n<li>Client error responses (400-499)<\/li>\n<li>Server error responses (500-599)<\/li>\n<\/ol>\n<\/li>\n<li><strong>Response.StatusText<\/strong> &#8211; \uc0c1\ud0dc \ucf54\ub4dc\uc5d0 \ud574\ub2f9\ud558\ub294 \uba54\uc138\uc9c0\ub97c \uc758\ubbf8\ud55c\ub2e4.<\/li>\n<li>Response.Type &#8211; \uc751\ub2f5 Type\uc744 \uc758\ubbf8\ud55c\ub2e4. \uc608\ub85c basic\uacfc col, opaque\uac00 \uc788\ub2e4. \uc774\uac83\uc740 \ub9ac\uc18c\uc2a4\uc758 \ucd9c\ucc98\ub97c \ub098\ud0c0\ub0b4\uba70 \uc751\ub2f5 \uac1d\uccb4\ub97c \ucc98\ub9ac\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\ub824\uc8fc\ub294 \uac83\uc5d0 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/li>\n<li><strong>Response.url <\/strong>&#8211; \uc751\ub2f5 url\uc774\ub2e4.<\/li>\n<\/ul>\n<h4>2.1.4 Response method\ub780?[2]<\/h4>\n<blockquote>\n<p><strong>Info<\/strong>: \ud83d\udca1 Response\uc758 \ubc18\ud658 method\ub294 \ud55c\ubc88\ub9cc \uc0ac\uc6a9\uc774 \uac00\ub2a5\ud558\ub2e4. \uc608\ub85c response.text()\ub97c \uc0ac\uc6a9\ud574 \ubcf8\ubb38\uc744 \uc77d\uace0 \ud14d\uc2a4\ud2b8\ub85c \ubc18\ud658\ud588\ub2e4\uba74 \ubaa8\ub4e0 \ub370\uc774\ud130\ub4e4\uc740 \ucc98\ub9ac\ub41c \uc0c1\ud0dc\uac00 \ub41c\ub2e4. \ub530\ub77c\uc11c \ucd94\ud6c4\uc5d0 \ub610 \ub2e4\ub978 Response \ubc18\ud658 method\ub97c \uc0ac\uc6a9\ud574\uc11c \ubcf8\ubb38\uc744 \ubc18\ud658\ud558\uc9c0 \ubabb\ud55c\ub2e4.<\/p>\n<\/blockquote>\n<ul>\n<li><strong>Response.json()<\/strong> &#8211; \uc751\ub2f5\ub41c \ubcf8\ubb38\uc758 \ud14d\uc2a4\ud2b8\ub97c JSON \ud615\uc2dd\uc73c\ub85c \ud30c\uc2f1\ud55c\ub2e4.<\/li>\n<li><strong>Response.text()<\/strong> &#8211; \uc751\ub2f5\ub41c \ubcf8\ubb38\uc744 \uc77d\uace0 \ud14d\uc2a4\ud2b8 \ud615\uc2dd\uc73c\ub85c \ubc18\ud658\ud55c\ub2e4.<\/li>\n<li><strong>Response.redirect(url, status)<\/strong> &#8211; URL\ub85c redirection\ud558\ub294 \uacb0\uacfc\ub97c \ubc18\ud658\ud55c\ub2e4. url\uc740 \uc0c8 \uc751\ub2f5\uc774 \uc2dc\uc791\ub418\ub294 URL\uc774\ub2e4. \uad04\ud638 \uc18d\uc5d0 \ub4e4\uc5b4\uac00\ub294 status\ub294 \uc751\ub2f5\uc5d0 \ub300\ud55c \ucf54\ub4dc\uc774\ub2e4.<\/li>\n<li><strong>Response.formData()<\/strong> &#8211; \uc751\ub2f5\ub41c \uac83\uc744 formData \ud615\uc2dd\uc73c\ub85c \ubc18\ud658\ud55c\ub2e4.<\/li>\n<li>Response.blob() &#8211; \uc2a4\ud2b8\ub9bc\uc744 \uac00\uc838\uc640 \uc644\ub8cc\ud560 \ub54c\uae4c\uc9c0 \uc77d\uc5b4 \ubc18\ud658\ud558\ub294 \uba54\uc11c\ub4dc\uc774\ub2e4.<\/li>\n<li>Response.arrayBuffer() &#8211; \uc751\ub2f5\ub41c \uac83\uc744 arrayBuffer \ud615\uc2dd\uc73c\ub85c \ubc18\ud658\ud55c\ub2e4.<\/li>\n<li>Response.clone() &#8211; \ub2e4\ub978 \ubcc0\uc218\uc5d0 \uc800\uc7a5\ub418\ub294 \uc751\ub2f5 \uac1d\uccb4\uc758 \ubcf5\uc81c\ubcf8\uc744 \ub9cc\ub4e0\ub2e4.<\/li>\n<li>Response.error() &#8211; \ub124\ud2b8\uc6cc\ud06c \uc624\ub958\uc640 \uad00\ub828\ub41c \uc751\ub2f5\uc758 \uc0c8\ub85c\uc6b4 \uac1d\uccb4\ub97c \ubc18\ud658\ud55c\ub2e4.<\/li>\n<\/ul>\n<h3>2.2 fetch() \uba54\uc11c\ub4dc<\/h3>\n<h4>2.2.1 fetch()\uc758 \uae30\ubcf8\uc801\uc778 \uc0ac\uc6a9\ubc29\ubc95<\/h4>\n<p>Fetch API \ub97c \uc774\uc6a9\ud574 \ub9ac\uc18c\uc2a4\ub97c \uc5bb\uc5b4\uc624\uae30 \uc704\ud574\uc11c fetch()\ub97c \uc774\uc6a9\ud558\ub294\ub370  fetch()\uc758 \uccab \ubc88\uc9f8 \uc778\uc790\ub294 <strong>\ud544\uc218 \ub9e4\uac1c\ubcc0\uc218<\/strong>\uc774\ub2e4. \uc774\uacf3\uc5d0\ub294 \ub450 \uac00\uc9c0\uac00 \ud615\ud0dc\uac00 \uc62c \uc218 \uc788\ub294\ub370 \uccab \ubc88\uc9f8 \ud615\ud0dc\ub294 <strong>\uac00\uc838\uc624\ub824\ub294 \ub9ac\uc18c\uc2a4\uc758 URL\uc744 \ub098\ud0c0\ub0b4\ub294 \ubb38\uc790\uc5f4 \ub610\ub294 \uac1d\uccb4<\/strong>\uc774\uace0 \ub450 \ubc88\uc9f8 \ud615\ud0dc\ub294<strong> Request() \uc0dd\uc131\uc790\ub85c \uc0dd\uc131\ub41c \uac1d\uccb4<\/strong>\uac00 \uc62c \uc218 \uc788\ub2e4. <\/p>\n<blockquote>\n<p><strong>Info<\/strong>: \ud83d\udca1 <strong>resource \uc640 fetch \uc758\ubbf8<\/strong><br \/>\n<strong>resource<\/strong> : \uc694\uccad\uc5d0 \ub530\ub77c \ubc18\ud658\ub418\ub294 \uc2dd\ubcc4\uac00\ub2a5\ud55c \ub370\uc774\ud130(\ubb38\uc11c, \uc0ac\uc9c4 \ub4f1\ub4f1)\ub97c \uc758\ubbf8\ud55c\ub2e4.<br \/>\n<strong>fetch<\/strong> : \uc0ac\uc804\uc801 \uc758\ubbf8\ub294 \u2018\ub2e4\ub978\uacf3\uc73c\ub85c \uac00\uc11c \ubb3c\uac74\uc774\ub098 \ub204\uad70\uac00\ub97c \ub370\ub7ec\uc624\ub294 \uac83\u2019 \uc774\ub2e4. \uc5ec\uae30\uc11c\ub294 resource \ub97c \uac00\uc838\uc628\ub2e4\uace0 \ud560 \uc218 \uc788\ub2e4.<\/p>\n<\/blockquote>\n<p>\uae30\ubcf8\uc801\uc778 \uc0ac\uc6a9 \ubb38\ubc95\uacfc \uc608\uc2dc\ub294 \uc544\ub798\uc640 \uac19\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">fetch(url)\nfetch(new Request() \ub85c \uc0dd\uc131\ub41c request \uac1d\uccb4)\nfetch(url, [options])\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;);\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">const request = new Request(&quot;https:\/\/jsonplaceholder.typicode.com\/post\/1&quot;);\n\nfetch(request)\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;,{\n\tmethod: &quot;POST&quot;,\n\theaders: &quot;Content-Type&quot;: &quot;application\/json&quot;,\n\tbody: {\n\t\ttitle: &quot;foo&quot;,\n\t\tbody: &quot;bar&quot;,\n\t\tuserId: 1\n\t}\n});\n<\/code><\/pre>\n<h4>2.2.2 <strong>Request() \uc0dd\uc131\uc790<\/strong><\/h4>\n<p>\uc6b0\ub9ac\uac00 fetch() \ud638\ucd9c\ud560\ub54c \ub9ac\uc18c\uc2a4 \uacbd\ub85c\ub97c \uc81c\uacf5\ud558\ub294 \ub300\uc2e0\uc5d0 <strong>Request() \uc0dd\uc131\uc790\ub85c \uc0dd\uc131\ud55c \uc694\uccad \uac1d\uccb4\ub97c \ud1b5\ud574 \uc778\uc790\ub85c \uc804\ub2ec\ud558\uc5ec \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4. \uadf8\ub807\ub2e4\uba74 Request() \uc0dd\uc131\uc790\ub780 \ubb34\uc5c7\uc77c\uae4c?<\/strong><code>Request()<\/code>\uc0dd\uc131\uc790\ub294 \uc0c8\ub85c\uc6b4 <strong>Request <\/strong>\uac1d\uccb4\ub97c \uc0dd\uc131\ud560 \uc218 \uc788\ub2e4.  <code>fetch()<\/code> \uba54\uc11c\ub4dc\uc758 \ub9e4\uac1c\ubcc0\uc218\uc640 \ub3d9\uc77c\ud558\uac8c \uccab\ubc88 \uc9f8 \uc778\uc790 \uac12 input\uc5d0\ub294 \uc811\uadfc\ud558\uace0\uc790 \ud558\ub294 URL \uc744 \ub2f4\uace0, \ub450 \ubc88\uc9f8 \uc778\uc790 \uac12 init\uc5d0\ub294 method\ub098 header, body \ub4f1\uc758 \uc635\uc158\uc744 \uc9c0\uc815\ud560 \uc218 \uc788\ub2e4.  <\/p>\n<pre><code class=\"language-javascript\">const myRequest = new Request(input, init);\n<\/code><\/pre>\n<p>\uc608\uc2dc<\/p>\n<pre><code class=\"language-javascript\">const myRequest = new Request(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n\theaders: {\n\t\t&quot;Content-Type&quot;: &quot;application\/json&quot;,\n\t},\n});\n\nfetch(myRequest)\n\t.then(res =&gt; res.json())\n\t.then(data =&gt; console.log(data));\n<\/code><\/pre>\n<p>\uae30\uc874\uc5d0 \uc874\uc7ac\ud558\ub294 \uc694\uccad \uac1d\uccb4\ub97c \uc804\ub2ec\ud574\uc11c \ubcf5\uc0ac\ubcf8\uc744 \uc0dd\uc131\ud558\ub294 \uac83\uc774 \uac00\ub2a5\ud558\ub2e4. \uc774\ub807\uac8c \ubcf5\uc0ac\ubcf8 \uc0dd\uc131\uc744 \ud574\ub450\uba74 \ub2e4\uc2dc \uae30\uc874\uc5d0 \uc0dd\uc131\ud574\ub454 \uc694\uccad\uacfc \uc751\ub2f5 \uac1d\uccb4\ub97c \ub2e4\uc2dc \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.  \ub610\ud55c \ub2e4\uc2dc \uc0ac\uc6a9\ud558\ub418, init \uc635\uc158\ub9cc \ub530\ub85c \uad50\uccb4\ud560 \uc218\ub3c4 \uc788\ub2e4. \ud558\uc9c0\ub9cc \uc774\ubbf8 \ubcf8\ubb38\uc744 \uc77d\uc740 \uc694\uccad \ub610\ub294 \uc751\ub2f5\uc744 \ubcf5\uc0ac\ud560 \uc218 \uc5c6\ub2e4. \uc989 \ubcf5\uc0ac\ubcf8\uc740 \uc6d0\ubcf8 \ubcf8\ubb38\uc744 \uc77d\uae30\uc804\uc5d0 \uc0dd\uc131\ud574\uc57c \ud55c\ub2e4.   <\/p>\n<pre><code class=\"language-javascript\">const copyRequest = new Request(myRequest);\n<\/code><\/pre>\n<blockquote>\n<p><strong>Info<\/strong>: \ud83d\udca1 \ucc38\uace0\ub85c, \uc624\uc9c1 \ubcf5\uc0ac\ubcf8 \uc0dd\uc131\uc744 \uc704\ud55c clone() \uba54\uc11c\ub4dc\ub3c4 \uc874\uc7ac\ud55c\ub2e4. \ud604\uc7ac Request \uac1d\uccb4\uc758 \ubcf5\uc0ac\ubcf8\uc744 \ub9cc\ub4dc\ub294 clone \uba54\uc11c\ub4dc \ub610\ud55c \ub9c8\ucc2c\uac00\uc9c0\ub85c \uc694\uccad \ubcf8\ubb38\uc774 \uc774\ubbf8 \uc0ac\uc6a9\ub41c \uacbd\uc6b0 TypeError\ub97c \ubc1c\uc0dd\uc2dc\ud0a8\ub2e4. \uc55e\uc11c \ubc30\uc6b4 Request \uc0dd\uc131\uc790\uc640 \ub3d9\uc77c\ud558\uac8c \ubcf5\uc0ac\ubcf8\uc744 \uc0dd\uc131\ud560 \uc218 \uc788\uc9c0\ub9cc clone\uba54\uc11c\ub4dc\uc758 \uc8fc\ub41c \ubaa9\uc801\uc740 body\uc758 object\uc758 \ub2e4\uc911 \uc0ac\uc6a9\uc744 \uc704\ud568\uc774\uace0, \uc694\uccad\uc744 \uc218\uc815\ud558\ub824\ub294 \uacbd\uc6b0\uc5d0\ub294 Request \uc0dd\uc131\uc790\ub97c \ub354 \uc120\ud638\ud55c\ub2e4.<\/p>\n<\/blockquote>\n<h4>2.2.3 fetch()\uc758 options<\/h4>\n<p>\ub450 \ubc88\uc9f8 \uc778\uc790 <strong>options<\/strong>\ub294 <strong>\uc120\ud0dd \ub9e4\uac1c\ubcc0\uc218<\/strong>\ub85c method\ub098 body \ub4f1 \uc694\uccad\uc744 \ucee4\uc2a4\ud140 \ud560 \uc218 \uc788\ub294 <strong>Request \uc0dd\uc131\uc790\uc758 \uc778\uc2a4\ud134\uc2a4 \ucd08\uae30\ud654<\/strong>\uc5d0 \uc0ac\uc6a9\ub41c\ub2e4. <strong>fetch()<strong>\uc758 \ub450 \ubc88\uc9f8 \uc778\uc790\ub85c <strong>options \uac1d\uccb4<\/strong>\ub97c \uc92c\ub294\ub370 <strong>Request \uc0dd\uc131\uc790<\/strong>\uac00 \ub098\uc624\ub294 \uc774\uc720\ub294  WHATWG \ubb38\uc11c\uc758<\/strong> fetch()<\/strong> \ubd80\ubd84\uc744 \uc0b4\ud3b4\ubcf4\uba74<strong> fetch()<\/strong> \uba54\uc11c\ub4dc\uac00 \ub2e4\uc74c\uacfc \uac19\uc740 \ud615\ud0dc\ub85c \ub418\uc5b4\uc788\uae30 \ub54c\ubb38\uc774\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">fetch(RequestInfo input, optional RequestInit init = {})\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/04-9.png\" alt=\"\"><\/p>\n<p>\uc989 <strong>fetch()<strong>\ub97c \ud638\ucd9c\ud558\uba74 \ub0b4\ubd80\uc801\uc73c\ub85c <strong>Request \uc0dd\uc131\uc790<\/strong>\ub97c \ud638\ucd9c\ud574\uc11c<\/strong> input, [init]<\/strong>\uc5d0 \uc785\ub825\ud55c \uc778\uc790\ub97c \ub358\uc838\uc8fc\uace0 <strong>request\uac1d\uccb4<\/strong>\ub97c \uc0dd\uc131\ud55c\ub2e4. \uc774\ub54c <strong>\ub450 \ubc88\uc9f8 \uc778\uc790<\/strong>\uac00 \uc5c6\uc73c\uba74 <strong>\uae30\ubcf8\uac12<\/strong>\uc73c\ub85c \ucd08\uae30\ud654\ub41c\ub2e4. <strong>fetch()<\/strong>\uc5d0 <strong>\uccab \ubc88\uc9f8 \uc778\uc790<\/strong>\ub9cc \uc8fc\uc5b4\uc84c\uc744 \ub54c \uc694\uccad\uc774 <code>GET<\/code>\uc73c\ub85c \uc804\ub2ec\ub418\ub294 \uac83\ub3c4 <strong>request<\/strong>\uc758 <code>method<\/code>\uc18d\uc131 \uae30\ubcf8\uac12\uc774 <code>GET<\/code>\uc774\uae30 \ub54c\ubb38\uc774\ub2e4.<br \/>\n\ub450\ubc88 \uc9f8 \uc778\uc790\ub85c \uc124\uc815\uac00\ub2a5 \ud55c \uc635\uc158\ub4e4\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4. \uba3c\uc800 <strong>Request \uc0dd\uc131\uc790<\/strong>\uc5d0 <code>url<\/code>\ub9cc \uc9d1\uc5b4\ub123\uace0 \ub85c\uadf8\ub97c \ud655\uc778\ud574\ubcf4\uba74 \uc635\uc158\ub4e4\uc758 \uae30\ubcf8\uac12\uc774 \ub4e4\uc5b4\uac04 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">req = new Request(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;);\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/05-8.png\" alt=\"\"><\/p>\n<p>\uc635\uc158\ub4e4\uc758 \uc790\uc138\ud55c \ub0b4\uc6a9\uc740 \ucd9c\ucc98<a href=\"https:\/\/fetch.spec.whatwg.org\/#request-class\">[2.2.3]<\/a> \uc5d0\uc11c \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<br \/>\n<strong>method<\/strong><br \/>\nHTTP\uc694\uccad \uba54\uc11c\ub4dc[1.3. HTTP\uc694\uccad \uba54\uc11c\ub4dc \ucc55\ud130 \ucc38\uace0] \uc640 \ub3d9\uc77c\ud558\ub2e4. \uc18c\ubb38\uc790\ub85c \uc791\uc131\ud574\ub3c4 \uc790\ub3d9\uc73c\ub85c \ub300\ubb38\uc790\ub85c \ubcc0\ud658\ub41c\ub2e4. \uae30\ubcf8\uac12\uc740 <code>GET<\/code>\uc774\ub2e4.<br \/>\n<strong>headers<\/strong><br \/>\nnew Header(init)\uc0dd\uc131\uc790\ub85c \uac1d\uccb4\ub97c \ub9cc\ub4e4\uc5b4\uc11c \ub123\uc744 \uc218\ub3c4 \uc788\uace0 \uac1d\uccb4 \ub9ac\ud130\ub7f4\uc744 \uadf8\ub300\ub85c \ub123\uc5b4\uc11c \uc124\uc815 \ud560 \uc218\ub3c4 \uc788\ub2e4.   \uc544\ub798\uc640 \uac19\uc774 \uc0ac\uc6a9 \ud55c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">let headers = new Headers({\n\t&quot;Content-Type&quot;: &quot;text\/xml&quot;\n});\n\/\/ \uac1d\uccb4 \ub9ac\ud130\ub7f4\uc744 \uc0dd\uc131\uc790\uc5d0 \uc804\ub2ec\ud574\uc11c \uc0dd\uc131\ud560 \uc218 \uc788\ub2e4\n\nheaders.append[&quot;Content-Type&quot;,&quot;application\/json&quot;]\n\/\/ \uba54\uc18c\ub4dc\ub4e4\uc744 \uc774\uc6a9\ud574 \ucd94\uac00, \uc81c\uac70, \uc870\ud68c \ub4f1\uc774 \uac00\ub2a5\ud558\ub2e4\n\nfetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;,{headers});\n\/\/ url\uacfc options \uc5d0 \uc0dd\uc131\ud55c headers \uac1d\uccb4\ub97c \ub123\uc5b4\uc11c fetch \uc694\uccad\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/06-8.png\" alt=\"\"><\/p>\n<p>\uac1c\ubc1c\uc790\ub3c4\uad6c \u2192 \ub124\ud2b8\uc6cc\ud06c \ud0ed\uc5d0\uc11c \uc694\uccad \ud5e4\ub354\ub97c \ucc3e\uc544\ubcf4\uba74 \uc124\uc815\ud55c \ubd80\ubd84\uc774 \ub4e4\uc5b4\uac04 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<br \/>\n\ub9cc\ub4e0 \uac1d\uccb4\ub97c <code>append()<\/code>, <code>delete()<\/code>, <code>get()<\/code>, <code>has()<\/code>, <code>set()<\/code>, <code>for()<\/code> \uac19\uc740 \uba54\uc18c\ub4dc\ub4e4\uc744 \uc0ac\uc6a9\ud574 \uc18d\uc131\ub4e4\uc744   \ucd94\uac00, \uc0ad\uc81c, \uc870\ud68c\ud560 \uc218 \uc788\ub2e4.<br \/>\n<strong>body<\/strong> : \uc694\uccad\uc5d0 \ucd94\uac00\ud560 \ubcf8\ubb38 \ud615\uc2dd <code>Blob<\/code>, <code>Array Buffer<\/code>, <code>TypeArray<\/code>, <code>DataView<\/code>, <code>FormData<\/code>,<strong> <strong><code>URLsearchParams<\/code>,<\/strong> <\/strong> <code>\ubb38\uc790\uc5f4 \uac1c\uccb4<\/code>,  <code>\ub9ac\ud130\ub7f4<\/code>, <code>ReadableStream<\/code> \uc774 \ub420 \uc218 \uc788\ub2e4.<br \/>\n\uc694\uccad \ud5e4\ub354\uc758 <code>Content-Type<\/code> \uacfc \uac19\uc544\uc57c \ud55c\ub2e4. <code>GET<\/code> \uc694\uccad\uc5d0\uc11c\ub294 \uc0ac\uc6a9\ud560 \uc218 \uc5c6\uace0 <strong>\uae30\ubcf8\uac12\uc740 <strong><strong><code>undefined<\/code><\/strong><\/strong> <\/strong>\uc774\ub2e4.<br \/>\n<strong>mode<\/strong> : \uc5b4\ub5a4 CORS \uc815\ucc45\uc744 \uc0ac\uc6a9\ud560\uc9c0 \uc124\uc815\ud55c\ub2e4<\/p>\n<ul>\n<li><strong>cors[\uae30\ubcf8\uac12]<\/strong> : \uc81c\uc0bc\uc790\uac00 \uc81c\uacf5\ud558\ub294 \ub2e4\uc591\ud55c API\ub97c \uc0ac\uc6a9\ud558\ub294\ub370 \uc81c\ud55c\uc774 \uc5c6\uc5b4\uc9c4\ub2e4.<\/li>\n<li>same-origin : \ud604\uc7ac Origin\uacfc \uac19\uc740 Origin\uc5d0\ub9cc \uc694\uccad\ud560 \uc218 \uc788\ub2e4.<\/li>\n<li>no-cors : \uba54\uc18c\ub4dc\uac00 <code>HEAD<\/code> <code>GET<\/code> \ub610\ub294 <code>POST<\/code>\uac00 \uc544\ub2cc \ub2e4\ub978 \uac83\uc774 \ub418\ub294 \uac83\uc744 \ubc29\uc9c0\ud558\uace0  <code>Accept<\/code>, <code>Accept-Language<\/code>, <code>Content-Type<\/code> \uac12\uc73c\ub85c <code>application\/x-www-form-urlencoded<\/code> <code>multpart\/formdata<\/code>, <code>text\/plain<\/code>\uc758 \uc9c0\uc815\ub41c \ud5e4\ub354\ub9cc \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<br \/>\n<strong>credentials<\/strong><\/li>\n<li>omit : \uc790\uaca9 \uc99d\uba85\uc744 \uc804\uc1a1\ud558\uc9c0 \uc54a\ub3c4\ub85d \ud55c\ub2e4.<\/li>\n<li><strong>same-origin[\uae30\ubcf8\uac12]<\/strong> : \uc694\uccad URL\uc774 \uac19\uc740 \ucd9c\ucc98\uc77c \ub54c\ub9cc \uc790\uaca9 \uc99d\uba85\uc744 \uc804\uc1a1\ud55c\ub2e4.<\/li>\n<li>include : fetch \uba54\uc11c\ub4dc\uc5d0 \uc790\uaca9\uc99d\uba85 \uc815\ubcf4\ub97c \ud568\uaed8 \uc804\uc1a1\ud55c\ub2e4. (\uc11c\ubc84\uc5d0\uc11c\ub3c4 \uc751\ub2f5\uc5d0\uc11c \ucc98\ub9ac\ub97c \ud574\uc918\uc57c \ud55c\ub2e4)<br \/>\n\uc790\uaca9 \uc99d\uba85\uc774 \ud568\uaed8 \uc804\uc1a1\ub418\ub294 \uc694\uccad\uc744 \ubcf4\ub0bc \ub550  <code>Access-Control-Allow-Origin : *<\/code> \uc744 \uc9c0\uc815\ud558\uc9c0 \ubabb\ud55c\ub2e4.<br \/>\n<strong>cache <\/strong>: \uae30\ubcf8\uac12\uc740 <strong>default<\/strong> \uc73c\ub85c \ud45c\uc900 HTTP-cache \uc815\ucc45\uacfc \ud5e4\ub354\ub4e4\uc744 \uc0ac\uc6a9\ud55c\ub2e4. \ub2e4\ub978 \uc124\uc815\uc73c\ub85c <code>no-store<\/code>,  <code>reload<\/code>, <code>no-cache<\/code>, <code>force-cache<\/code>, <code>or only-if-cached<\/code> \uc758 \uc635\uc158\ub4e4\uc774 \uc788\ub2e4.<br \/>\n<strong>redirect<\/strong> : \ub9ac\ub2e4\uc774\ub809\ud2b8 \uc751\ub2f5\uc744 \uc5b4\ub5bb\uac8c \ucc98\ub9ac\ud560\uc9c0 \uc124\uc815\ud55c\ub2e4.<\/li>\n<li><strong>follow[\uae30\ubcf8\uac12] : <\/strong>\ub9ac\ub2e4\uc774\ub809\ud2b8 \uc751\ub2f5\uc744 \ud5c8\uc6a9\ud55c\ub2e4.<\/li>\n<li>error : \ub9ac\ub2e4\uc774\ub809\ud2b8 \uc751\ub2f5\uc744 \uc5d0\ub7ec\ub85c \ucc98\ub9ac\ud55c\ub2e4.<\/li>\n<li>manual : \ub9ac\ub2e4\uc774\ub809\ud2b8\ub97c \ud5c8\uc6a9\ud558\uc9c0 \uc54a\ub294\ub2e4.<br \/>\nreferrer : \uc790\ub3d9\uc73c\ub85c \ub124\ud2b8\uc6cc\ud06c \uc694\uccad\uc744 \ucc98\uc74c \uc2dc\uc791\ud55c \ud398\uc774\uc9c0\uc758 \uc815\ubcf4\ub97c \ub2f4\uace0 \uc788\ub2e4.<br \/>\nreferrerPolicy :\uc694\uccad\uc5d0 \uc801\uc6a9 \ud560 \ub808\ud37c\ub7ec \uc815\ucc45\uc744 \uc124\uc815\ud55c\ub2e4. <strong><code>no-referrer[\uae30\ubcf8\uac12]<\/code><\/strong>, <code>*no-referrer-when-downgrade<\/code>, <code>origin, origin-when-cross-origin<\/code>, <code>same-origin, strict-origin<\/code>, <code>strict-origin-when-cross-origin<\/code>, <code>unsafe-url<\/code>\uc758 \uc635\uc158\uc774 \uc788\ub2e4.<br \/>\nintegrity : \uc751\ub2f5\uc774 \ubbf8\ub9ac\uc54c\ub824\uc9c4 \uccb4\ud06c\uc12c\uacfc \uc77c\uce58\ud558\ub294\uc9c0 \ud655\uc778\ud560 \uc218 \uc788\ub294 \uc124\uc815\uc774\ub2e4.<br \/>\nkeepalive : <strong>\uae30\ubcf8\uac12\uc740 <\/strong>**<code>false<\/code><strong>\ub85c \uc694\uccad\uc774 \ud398\uc774\uc9c0\ub97c \ub098\uc640\uc11c\ub3c4 \uc720\uc9c0\ud560 \uc218 \uc788\uac8c \ud574\uc8fc\ub294 \uc124\uc815\uc774\ub2e4.<br \/>\nsignal : fetch \uc694\uccad\uc744 <code>AbortController<\/code> \uc744 \uc0ac\uc6a9\ud574 <strong> \uc911\ub2e8<\/strong>\uc2dc\ud0ac \uc218 \uc788\ub294 <code>AbortSignal<\/code><\/strong> \uac1d\uccb4**\uc774\ub2e4.<\/li>\n<\/ul>\n<blockquote>\n<p><strong>Info<\/strong>: \ud83d\udca1 AbortController \uc740 \ud558\ub098 \uc774\uc0c1\uc758 \uc6f9 \uc694\uccad\uc744 \ucde8\uc18c\ud560 \uc218 \uc788\uac8c \ud574\uc8fc\ub294 \uc778\ud130\ud398\uc774\uc2a4 \uc774\ub2e4.<br \/>\nAbortSignal \uac1d\uccb4\ub294 AbortController() \uc0dd\uc131\uc790\ub85c \uc0dd\uc131\ud55c DOM \uc694\uccad\uacfc \ud1b5\uc2e0\ud558\uac70\ub098 \ucde8\uc18c\ud558\ub294\ub370 \uc0ac\uc6a9\ub418\ub294 \uac1d\uccb4 \uc778\ud130\ud398\uc774\uc2a4\uc774\ub2e4.<\/p>\n<\/blockquote>\n<h2>3. Fetch \uc0ac\uc6a9\ud574\ubcf4\uae30<\/h2>\n<h3>\u2757<strong>\uc2e4\uc2b5 \uc804 \ucc38\uace0\uc0ac\ud56d<\/strong><\/h3>\n<h4><strong>\uc2e4\uc2b5\uc6a9 API \uc0ac\uc774\ud2b8 \uc774\uc6a9 \ubc29\ubc95<\/strong><\/h4>\n<p>\uc6b0\ub9ac\ub294 \uc2e4\uc2b5\uc744 \uc704\ud574 <strong>{JSON} Placeholder(<strong><a href=\"https:\/\/jsonplaceholder.typicode.com\/\">https:\/\/jsonplaceholder.typicode.com\/<\/a><\/strong>)<\/strong>\ub97c \uc774\uc6a9\ud560 \uac83\uc774\ub2e4. {JSON} Placeholder\ub294 \ubb34\ub8cc\ub85c \uac00\uc0c1\ub370\uc774\ud130\ub97c \uc774\uc6a9\ud560 \uc218 \uc788\ub294 API \uc81c\uacf5 \uc0ac\uc774\ud2b8\uc774\ub2e4.<\/p>\n<p>\uc55e\uc73c\ub85c Fetch \uc2e4\uc2b5\uc5d0 \uc0ac\uc6a9\ud560 API \uc8fc\uc18c\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<blockquote>\n<p><strong>Info<\/strong>: \ud83c\udf10 <a href=\"https:\/\/jsonplaceholder.typicode.com\/posts\/1\">https:\/\/jsonplaceholder.typicode.com\/posts\/1 <\/a><\/p>\n<\/blockquote>\n<p>\uc704 \uc8fc\uc18c\ub97c \ub4e4\uc5b4\uac00 \ubcf4\uba74 \ub2e4\uc74c\uacfc \uac19\uc740 \ub370\uc774\ud130\ub97c \ubcfc \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-json\">{\n\tuserId: 1,\n\tid: 1,\n\ttitle: &quot;sunt aut facere repellat provident occaecati excepturi optio reprehenderit&quot;,\n\tbody: &quot;quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae ut ut quas totam nostrum rerum est autem sunt rem eveniet architecto&quot;,\n}\n<\/code><\/pre>\n<p>\uc6b0\ub9ac\ub294 \uc55e\uc73c\ub85c \uc774 \uac00\uc0c1 \ub370\uc774\ud130\uc5d0 Fetch\ub97c \uc774\uc6a9\ud558\uc5ec GET, POST, PUT, PATCH, DELETE \uc694\uccad\uc744 \uac01\uac01 \ud574\uc8fc\uc5c8\uc744\ub54c \ub370\uc774\ud130\uac00 \uc5b4\ub5bb\uac8c \ubcc0\ud654\ud558\ub294\uc9c0 \uc2e4\uc2b5\uc744 \ud560 \uac83\uc774\ub2e4.<br \/>\n\ud558\uc9c0\ub9cc \uc704 \uc0ac\uc774\ud2b8\ub294 API \uc2e4\uc2b5\uc6a9 \uc0ac\uc774\ud2b8\uc774\uae30 \ub54c\ubb38\uc5d0 HTTP \uba54\uc18c\ub4dc\ub97c \ud1b5\ud574 \ub0b4\ubd80 \ub370\uc774\ud130\uc5d0 CRUD\ub97c \ud558\ub824\uace0 \ud574\ub3c4 \uc2e4\uc81c\ub85c \ub370\uc774\ud130\uc5d0 \uc544\ubb34\ub7f0 \ubcc0\ud654\uac00 \uc5c6\ub2e4. \ub530\ub77c\uc11c \uc2e4\uc2b5 \ud6c4 \ud574\ub2f9 API\uc8fc\uc18c\ub97c \ub4e4\uc5b4\uac00 \ub370\uc774\ud130\uac00 \ubcc0\uacbd\ub418\uc9c0 \uc54a\uc558\ub2e4\uace0 \ub2f9\ud669\ud558\uc9c0 \uc54a\uae38 \ubc14\ub780\ub2e4. \ub300\uc2e0 \uc6b0\ub9ac\ub294 \ube0c\ub77c\uc6b0\uc800\uc758 \ucf58\uc194\ucc3d\uc73c\ub85c \ub370\uc774\ud130\ub97c \ud655\uc778\ud560 \uac83\uc774\ub2e4.<\/p>\n<h4><strong>\ube0c\ub77c\uc6b0\uc800 \ucf58\uc194\ucc3d\uc73c\ub85c \uc131\uacf5 \ud655\uc778 \ubc29\ubc95<\/strong><\/h4>\n<p>Fetch \uc2e4\uc2b5 \uc131\uacf5\uc740 \ube0c\ub77c\uc6b0\uc800 \ucf58\uc194\uc5d0\uc11c \ud655\uc778\ud560 \uc218 \uc788\ub2e4. \uc544\ub798 \uc774\ubbf8\uc9c0\uc640 \uac19\uc740 \ub0b4\uc6a9\uc774 \ucd9c\ub825\ub41c\ub2e4\uba74 \uc131\uacf5\uc801\uc73c\ub85c \ud1b5\uc2e0\uc5d0 \uc131\uacf5\ud588\ub2e4\uace0 \ud560 \uc218 \uc788\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/07-6.png\" alt=\"\"><\/p>\n<h4>\uc2e4\uc2b5\uc2dc \uc0ac\uc6a9\ud560 fetch()<strong>\uc758 \uae30\ubcf8 \uad6c\uc870<\/strong><\/h4>\n<p>\uc55e\uc11c \uc0b4\ud3b4\ubcf4\uc558\ub4ef\uc774 Fetch API \ub97c \uc774\uc6a9\ud574 \ub9ac\uc18c\uc2a4\ub97c \uc5bb\uc5b4\uc624\uae30 \uc704\ud574\uc11c fetch() \ub97c \uc774\uc6a9\ud55c\ub2e4. \uc6b0\ub9ac\ub294 \uc2e4\uc2b5\uc744 \ud560 \ub54c resource \uc640 options\ub97c \uc785\ub825\ud558\ub294 \uc544\ub798\uc640 \uac19\uc740 \uad6c\uc870\ub85c \uc0ac\uc6a9\ud560 \uac83\uc774\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;,{\n\tmethod: &quot;POST&quot;,\n\theaders: &quot;Content-Type&quot;: &quot;application\/json&quot;,\n\tbody: {\n\t\ttitle: &quot;foo&quot;,\n\t\tbody: &quot;bar&quot;,\n\t\tuserId: 1\n\t}\n});\n<\/code><\/pre>\n<p>Fetch\ub97c \uc0ac\uc6a9\ud558\uc5ec <code>method<\/code>, <code>headers<\/code>, <code>body<\/code>\ub85c \uc774\ub8e8\uc5b4\uc9c4 \uc694\uccad \uac1d\uccb4\uc5d0 \ub2f4\uc544\uc11c \ubcf4\ub0b8\ub2e4. \ub2e8, POST \uc694\uccad\uc5d0\uc11c\ub294 <code>body<\/code>\ub97c \ud544\uc218\ub85c \ub123\uc5b4\uc918\uc57c \ud55c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">{\n\tmethod: &quot;GET\/POST\/PUT\/PATCH\/DELETE \uc911 \ud0dd\uc77c&quot;, \/\/ \uc0ac\uc6a9\ud558\uace0\uc790 \ud558\ub294 \uba54\uc11c\ub4dc\uc758 \uc774\ub984\uc744 \uba85\uc2dc\n  headers:, \/\/ \uc11c\ubc84\uc5d0 \uc804\uc1a1\ud560 \ub370\uc774\ud130\uc5d0 \ub300\ud55c \uc815\ubcf4\ub97c \uc791\uc131\n  body:, \/\/ \uc11c\ubc84\uc5d0 \uc804\uc1a1\ud560 \ub370\uc774\ud130\ub97c \uc791\uc131\n}\n<\/code><\/pre>\n<p><code>method<\/code>\uc5d0\ub294 \uba54\uc11c\ub4dc\uc758 \uc774\ub984\uc744 \uba85\uc2dc\ud574\uc8fc\uc5b4\uc57c \ud55c\ub2e4.<br \/>\n<code>headers<\/code> \uc548\uc5d0\ub294 \uc11c\ubc84\uc5d0 \uc804\uc1a1\ud560 \ub370\uc774\ud130\uc758 \uc591\uc2dd\uc744  <code>Content-Type<\/code> \uc73c\ub85c \uba85\uc2dc\ud574\uc8fc\uc5b4\uc57c \ud55c\ub2e4. \uc778\uc99d\uc774 \ud544\uc694\ud55c \uacbd\uc6b0 <code>Authentification<\/code> \uc5d0 \ud1a0\ud070\uc744 \uc801\uc5b4\uc8fc\uae30\ub3c4 \ud55c\ub2e4.<br \/>\n<code>body<\/code>\uc5d0\ub294 \uc11c\ubc84\uc5d0 \uc804\uc1a1\ud560 \ub370\uc774\ud130\ub97c \uc801\uc5b4\uc900\ub2e4. \uc21c\uc218 \ud14d\uc2a4\ud2b8\ub85c \uc804\uc1a1\ud558\uae30\ub3c4 \ud558\uc9c0\ub9cc, <code>&lt;form&gt;<\/code> \ub4f1\uc758 HTML \uc591\uc2dd\uc774\ub098 JSON \uc591\uc2dd\uc73c\ub85c \uc804\uc1a1\ud558\uae30\ub3c4 \ud55c\ub2e4.<\/p>\n<h3>3.1 GET \uc694\uccad<\/h3>\n<h4>3.1.1 GET\uc774\ub780?<\/h4>\n<p>GET \uc694\uccad\uc740 \ud2b9\uc815\ud55c \ub9ac\uc18c\uc2a4\ub97c \uac00\uc838\uc624\ub3c4\ub85d \uc694\uccad\ud55c\ub2e4. \ub370\uc774\ud130\ub97c \uac00\uc838\uc62c \ub54c\ub9cc \uc0ac\uc6a9\ud574\uc57c \ud558\uba70, data\ub97c  <code>body<\/code> \uc5d0 \ub2f4\uc9c0 \uc54a\uace0 URL\uc5d0\uc11c \ub370\uc774\ud130\ub97c \ud3ec\ud568\uc2dc\ucf1c \uc694\uccad\ud55c\ub2e4. \ub530\ub77c\uc11c \ubcf4\uc548\uc5d0 \ucde8\uc57d\ud558\uae30 \ub54c\ubb38\uc5d0 \ubbfc\uac10\ud55c \uc815\ubcf4\ub294 \ub2f4\uc9c0 \uc54a\uc544\uc57c\ud55c\ub2e4. <\/p>\n<h4>3.1.2 \uc0ac\uc6a9\ubc29\ubc95<\/h4>\n<p>fetch\ud568\uc218\uc5d0\uc11c method\ub97c \uc785\ub825\ud558\uc9c0 \uc54a\uc73c\uba74 \uae30\ubcf8\uac12\uc740 <code>GET<\/code> \uc774\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">fetch(API_url, {method: &quot;GET&quot;})\n<\/code><\/pre>\n<h4>3.1.3 \uc2e4\uc2b5 \uc608\uc81c<\/h4>\n<p> <a href=\"https:\/\/jsonplaceholder.typicode.com\/\">https:\/\/jsonplaceholder.typicode.com\/<\/a>\uc5d0\uc11c posts\uc758 1\ubc88 \uac8c\uc2dc\ubb3c\uc744 \uac00\uc838\uc640 \ubcf4\uaca0\ub2e4. \uba3c\uc800 <code>fetch<\/code> \ub97c \uc774\uc6a9\ud574 \uacb0\uacfc\uac12\uc744 \ucf58\uc194\uc5d0 \ucc0d\uc5b4\ubcf4\uc790.<\/p>\n<p><strong>\uc608\uc81c1. \uc694\uccad \ud30c\ub77c\ubbf8\ud130\ub97c \uc0ac\uc6a9\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">function getData(url = &quot;&quot;) {\n\tfetch(url, {\n\t\tmethod: &quot;GET&quot;,\n\t\theaders: {\n\t\t\t&quot;Content-Type&quot;: &quot;application\/json&quot;,\n\t\t},\n\t})\n\t.then((res) =&gt; res.json())\n\t.then((res) =&gt; console.log(res))\n\t.catch((error) =&gt; console.log(error.message));\n}\n\ngetData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;);\n<\/code><\/pre>\n<p><strong>\uc608\uc81c2. async\/await\uc744 \uc0ac\uc6a9\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function getData(url = &quot;&quot;){\n  try{\n    const response = await fetch(url);\n    const res = await response.json();  \n    console.log(res);\n  }\n  catch(error){\n\t\tconsole.log(error);\n\t}\n}\n\ngetData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;);\n<\/code><\/pre>\n<p><strong>\uc608\uc81c3. async\/await\uc73c\ub85c \ub9cc\ub4e0 \ud568\uc218\ub97c \ud638\ucd9c \ud6c4 then\uc73c\ub85c \uacb0\uacfc \ucd9c\ub825\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function getData(url = &quot;&quot;) {\n  try {\n    const response = await fetch(url, {\n      method: &quot;GET&quot;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n    });\n    return response.json();\n  } catch (error) {\n    console.log(error.message);\n  }\n}\n\ngetData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n}).then((data) =&gt; {\n  console.log(data);\n});\n<\/code><\/pre>\n<p>\uc704 \uc608\uc81c\ub4e4\uc758 \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/08-5.png\" alt=\"\"><\/p>\n<p>\uc774\ub807\uac8c posts\uc758 1\ubc88\uac8c\uc2dc\ubb3c\uc758 data\uac00 \uc798 \ubd88\ub7ec\uc640\uc9c4 \uac83\uc744 \uc54c \uc218 \uc788\ub2e4.<\/p>\n<h3>3.2 POST \uc694\uccad<\/h3>\n<h4>3.2.1 POST\ub780?<\/h4>\n<p>POST\ub294 \uc11c\ubc84\ub85c \ub370\uc774\ud130\ub97c \uc804\uc1a1\ud558\ub294 HTTP \uba54\uc11c\ub4dc\uc774\ub2e4.[1] \uc8fc\ub85c \uc11c\ubc84\uc5d0 \ub370\uc774\ud130\ub97c \uc0dd\uc131\ud560 \ub54c \uc0ac\uc6a9\ud55c\ub2e4.<br \/>\nGET \uba54\uc11c\ub4dc\ub85c\ub3c4 \uc11c\ubc84\uc5d0 \ub370\uc774\ud130\ub97c \uc804\uc1a1\ud560 \uc218 \uc788\uc9c0\ub9cc, POST \uba54\uc11c\ub4dc\ub294 \ub300\uc6a9\ub7c9\uc758 \ub370\uc774\ud130\ub3c4 \uc804\uc1a1\ud560 \uc218 \uc788\uace0 \uc804\uc1a1\ud560 \ub370\uc774\ud130\uc758 \ub0b4\uc6a9\uc774 URL\uc5d0 \ub098\ud0c0\ub098\uc9c0 \uc54a\uae30 \ub54c\ubb38\uc5d0 \ub370\uc774\ud130\uc758 \uc804\uc1a1\uc5d0\ub294 POST\uac00 \ud6e8\uc52c \uc801\ud569\ud558\ub2e4.<\/p>\n<h4>3.2.2 \uc0ac\uc6a9 \ubc29\ubc95<\/h4>\n<p>POST \uc694\uccad\uc5d0\uc11c\ub294 \uc11c\ubc84\uc5d0 \uc0dd\uc131\ud560 \ub370\uc774\ud130\ub97c <code>body<\/code>\uc5d0 \ub2f4\uc544\uc8fc\uc5b4\uc57c \ud55c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">fetch(API_url, {method: &quot;POST&quot;, body: \ub370\uc774\ud130})\n<\/code><\/pre>\n<h4>3.2.3 \uc2e4\uc2b5 \uc608\uc81c<\/h4>\n<p>POST\ub97c \uc774\uc6a9\ud558\uc5ec \uc544\ub798\uc640 \uac19\uc740 \ub370\uc774\ud130\ub97c <a href=\"https:\/\/jsonplaceholder.typicode.com\/posts\">https:\/\/jsonplaceholder.typicode.com\/posts<\/a> \uc5d0 \uc0dd\uc131\ud558\ub294 \uc2e4\uc2b5\uc744 \ud574 \ubcf4\uc790.<\/p>\n<pre><code class=\"language-json\">{\n  title: &quot;Post test&quot;,\n\tbody: &quot;fetch\uc758 Post \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n\tuserId: 2,\n}\n<\/code><\/pre>\n<p><strong>\uc608\uc81c1. \uc694\uccad \ud30c\ub77c\ubbf8\ud130\ub97c \uc0ac\uc6a9\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">function postData(url = &quot;&quot;, data = {}) {\n    fetch(url, {\n      method: &quot;POST&quot;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n      body: JSON.stringify(data),\n    })\n\t\t.then((res) =&gt; res.json())\n\t\t.then((res) =&gt; console.log(res))\n\t  .catch((error)=&gt;console.log(error.message));\n}\n\npostData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;, {\n  title: &quot;Post test&quot;,\n\tbody: &quot;fetch\uc758 Post \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n\tuserId: 2,\n});\n<\/code><\/pre>\n<p><strong>\uc608\uc81c2. async\/await\uc744 \uc0ac\uc6a9\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function postData(url = &quot;&quot;, data = {}) {\n  try {\n    const response = await fetch(url, {\n      method: &quot;POST&quot;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n      body: JSON.stringify(data),\n    });\n    const res = await response.json();\n\t\tconsole.log(res);\n  } catch (error) {\n    console.log(error.message);\n  }\n}\n\npostData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;, {\n  title: &quot;Post test&quot;,\n  body: &quot;fetch\uc758 Post \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n\tuserId: 2,\n})\n<\/code><\/pre>\n<p><strong>\uc608\uc81c3. async\/await\uc73c\ub85c \ub9cc\ub4e0 \ud568\uc218\ub97c \ud638\ucd9c \ud6c4 then\uc73c\ub85c \uacb0\uacfc \ucd9c\ub825\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function postData(url = &quot;&quot;, data = {}) {\n  try {\n    const response = await fetch(url, {\n      method: &quot;POST&quot;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n      body: JSON.stringify(data),\n    });\n    return response.json();\n  } catch (error) {\n    console.log(error.message);\n  }\n}\n\npostData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;, {\n  title: &quot;Post test&quot;,\n  body: &quot;fetch\uc758 Post \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n\tuserId: 2,\n}).then((data) =&gt; {\n  console.log(data);\n});\n<\/code><\/pre>\n<p>\ud568\uc218\ub97c \uc2e4\ud589\ud558\uace0 \uacb0\uacfc\ub97c \ud655\uc778\ud574 \ubcf4\uc790. \ucf58\uc194\uc5d0 \uc544\ub798\uc640 \uac19\uc774 \ucd9c\ub825\ub41c\ub2e4\uba74 \uc131\uacf5\uc774\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/09-4.png\" alt=\"\"><\/p>\n<h3>3.3 PUT \uc694\uccad<\/h3>\n<h4>3.3.1 PUT\uc774\ub780?<\/h4>\n<p>PUT\uc740 \uc0c8\ub85c\uc6b4 \ub370\uc774\ud130\ub97c \uc0dd\uc131\ud558\ub294 POST\uc640 \ub2ec\ub9ac \uae30\uc874\uc5d0 \uc788\ub294 <strong>\ub370\uc774\ud130\ub97c \uc218\uc815(Update)<\/strong>\ud558\uace0\uc2f6\uc744 \ub54c \uc0ac\uc6a9\ud55c\ub2e4. PUT\uc744 \uc2e4\ud589\ud558\uba74 \uc774\ud6c4 POST\uac00 \uc2e4\ud589\ud558\ub294 \ud615\ud0dc\ub85c POST\uc640 PUT\uc740 \uc0dd\uae40\uc0c8\uac00 \uc544\uc8fc \ube44\uc2b7\ud558\ub2e4. PUT\uacfc POST\uc758 \ucc28\uc774\uc810\uc744 \uc54c\uc544\ubcf4\uc790. <\/p>\n<h4>3.3.2 PUT\uc758 \uc0ac\uc6a9 \ubc29\ubc95<\/h4>\n<p>PUT\uc744 \uac04\ub2e8\ud558\uac8c \uc0ac\uc6a9\ud560 \ub54c\ub294 <code>method<\/code>, <code>headers<\/code>, <code>body<\/code>\ub85c \uad6c\uc131\ud55c\ub2e4. \uac01\uac01 <code>method<\/code>\ub294 <code>\u2018PUT\u2019<\/code>\uc73c\ub85c,  json \ud615\uc2dd\uc744 \uc0ac\uc6a9\ud558\uba74 <code>headers<\/code>\ub294  <code>&#39;Content-Type&#39;: &#39;application\/json&#39;<\/code>\uc73c\ub85c, <code>body<\/code>\uc5d0\ub294 <code>JSON.stringify(\uc804\uc1a1\ud560\ub370\uc774\ud130)<\/code>\ub97c \uc791\uc131\ud55c\ub2e4. \uc5ec\uae30\uc11c \uc8fc\uc758\ud560 \uac83\uc740 <code>headers<\/code> \uc5d0 \uc124\uc815\ud55c \ud0c0\uc785\uacfc <code>body<\/code> \uc758 \ud0c0\uc785\uc774 \uac19\uc544\uc57c \ud55c\ub2e4\ub294 \uc810\uc774\ub2e4. \uc8fc\ub85c \uc0ac\uc6a9\ud558\ub294 \uba54\uc18c\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">{\n  method: &quot;PUT&quot;, \/\/ **\u201cPUT\u201d**\ub77c\uace0 \uba54\uc11c\ub4dc\uc758 \uc774\ub984\uc744 \uba85\uc2dc\n  headers:, \/\/ \uc11c\ubc84\uc5d0 \uc804\uc1a1\ud560 \ub370\uc774\ud130\uc758 \uc591\uc2dd\uc744 &quot;Content-Type&quot;\uc73c\ub85c \uba85\uc2dc\n  body:, \/\/ \uc11c\ubc84\uc5d0 \uc804\uc1a1\ud560 \ub370\uc774\ud130\ub97c \uc791\uc131\n}\n<\/code><\/pre>\n<p><strong>POST\uc640 PUT\uc758 \ube44\uad50<\/strong><br \/>\nPUT\uc758 \uc608\uc81c\ub294 \uc55e\uc11c \uc18c\uac1c\ud55c POST\uc640 PUT\uc744 \ube44\uad50\ud558\uc5ec \uc54c\uc544\ubcf4\uaca0\ub2e4. <strong>\uc11c\ubc84 \uc8fc\uc18c<\/strong>\uc640 <strong>method<\/strong>\uc5d0 \uc8fc\ubaa9\ud558\uc790.<\/p>\n<pre><code class=\"language-javascript\">async function postData(url = &quot;&quot;, data = {}) {\n\ttry {\n\t\tconst response = await fetch(url, {\n\t\t\tmethod: &quot;POST&quot;,\n\t\t\theaders: {\n\t\t\t\t&quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n      body: JSON.stringify(data),\n    });\n    return response.json();\n  } catch (error) {\n    console.log(error.message);\n  }\n}\n\npostData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;, {\n  title: &quot;Post test&quot;,\n  body: &quot;fetch\uc758 Post \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n  userId: 2,\n}).then((data) =&gt; {\n  console.log(data);\n});\n<\/code><\/pre>\n<p>\uc804\uc1a1\ud55c \ub370\uc774\ud130\uac00 \uc798 \ucd9c\ub825\ub418\ub294 \ubaa8\uc2b5\uc744 \ub2e4\uc74c\uacfc \uac19\uc774 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/10-3.png\" alt=\"\"><\/p>\n<p>\ub2e4\uc74c\uc740 PUT \ubc29\uc2dd\uc73c\ub85c \uc791\uc131\ud55c \ucf54\ub4dc\uc774\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">async function putData(url = &quot;&quot;, data = {}) {\n  try {\n    const response = await fetch(url, {\n      method: &quot;PUT&quot;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n      body: JSON.stringify(data),\n    });\n    return response.json();\n  } catch (error) {\n    console.log(error.message);\n\t}\n}\n\nputData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n  id: 1,\n  title: &quot;Put test&quot;,\n  body: &quot;fetch\uc758 Put \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n  userId: 1,\n}).then((data) =&gt; {\n  console.log(data);\n});\n<\/code><\/pre>\n<p>PUT\uc5d0\uc11c\ub3c4 \ub2e4\uc74c\uacfc \uac19\uc774 \uc804\uc1a1\ud55c \ub370\uc774\ud130\ub97c \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/11-4.png\" alt=\"\"><\/p>\n<p>\uc704\uc758 \ub450 \uc608\uc81c\ub97c \ube44\uad50\ud558\uba74 method\uc640 \uc11c\ubc84\uc8fc\uc18c\uac00 \ub2e4\ub974\ub2e4\ub294 \uc0ac\uc2e4\uc744 \ud655\uc778 \ud560 \uc218 \uc788\ub2e4. POST\uc758 \uc11c\ubc84 \uc8fc\uc18c\ub294 &quot;<a href=\"https:\/\/jsonplaceholder.typicode.com<strong>\/posts&#8221;>https:\/\/jsonplaceholder.typicode.com<\/strong>\/posts<\/a><strong>&quot; \uc774\uace0 PUT\uc758 \uc11c\ubc84 \uc8fc\uc18c\ub294 &quot;<a href=\"https:\/\/jsonplaceholder.typicode.com\">https:\/\/jsonplaceholder.typicode.com<\/a><\/strong>\/posts\/1**&quot; \uc774\ub2e4. \ub450 \uc8fc\uc18c\uc758 \ucc28\uc774\uc810\uc740 <code>\/posts<\/code> \ub4a4\uc5d0 <code>\/1<\/code> \uc758 \uc720\ubb34\uc774\ub2e4. \ub9cc\uc57d PUT\uc5d0 POST\uc758 \uc11c\ubc84 \uc8fc\uc18c\ub97c \uc791\uc131\ud55c\ub2e4\uba74 \uc5b4\ub5a4 \uacb0\uacfc\uac00 \ub098\ud0c0\ub0a0\uae4c? PUT \uba54\uc18c\ub4dc\uc5d0 POST\uc640 \uac19\uc740 \uc8fc\uc18c\ub97c \ub123\uc73c\uba74 \uc544\ub798\uc640 \uac19\uc740 \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud55c\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/12-3.png\" alt=\"\"><\/p>\n<p>404 \uc5d0\ub7ec \ucf54\ub4dc\ub294 \uc11c\ubc84\ub97c \ucc3e\uc558\uc73c\ub098 \ud574\ub2f9 \uc11c\ubc84 \ub0b4\uc5d0 \ud544\uc694\ud55c \ud30c\uc77c\uc744 \ucc3e\uc9c0 \ubabb\ud588\uc744 \ub54c \ubc1c\uc0dd\ud558\ub294 \uc624\ub958\ucf54\ub4dc\uc774\ub2e4.<br \/>\n\uc774\uac83\uc774 \uc758\ubbf8\ud558\ub294 \ubc14\ub97c \ud55c\ubc88 \uc0dd\uac01\ud574\ubcf4\uc790. POST\uc758 \uacbd\uc6b0\uc5d0\ub294 \uc694\uccad \ud560 \ub54c \ub9c8\ub2e4 \uc0c8\ub85c\uc6b4 \ub370\uc774\ud130\ub97c \uc0dd\uc131\ud558\uc5ec \ud2b9\uc815 \ud30c\uc77c\uc744 \ucc3e\uc9c0 \uc54a\uc544\ub3c4 \ub418\ub294 \ubc18\uba74 PUT\uc740 \uae30\uc874\uc758 \ub370\uc774\ud130\ub97c \uc218\uc815\ud574\uc57c \ud558\uae30 \ub54c\ubb38\uc5d0 \ud2b9\uc815 \ud30c\uc77c\uc744 \uc9c0\uc815\ud574\uc8fc\uc5b4\uc57c \ub3d9\uc791\ud560 \uc218 \uc788\ub2e4. \uadf8\ub798\uc11c \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud588\uace0, POST\ub4a4\uc5d0 \uac8c\uc2dc\ubb3c\uc758 id \uac12\uc778 <code>\/1<\/code>\uc744 \uc9c0\uc815\ud574\uc57c \ud558\ub294 \uc774\uc720\uc774\ub2e4.<\/p>\n<h4>3.3.3 \uc2e4\uc2b5 \uc608\uc81c<\/h4>\n<p>\ub2e4\uc74c\uc740 PUT\uc758 \ub2e4\uc591\ud55c \uc791\uc131\ubc29\ubc95\uc774\ub2e4. \ucd9c\ub825 \uacb0\uacfc\ub294 \uc55e\uc5d0 \uc124\uba85\ud588\ub358 \uc608\uc2dc\uc640 \uac19\ub2e4.<\/p>\n<p><strong>\uc608\uc81c1. \uc694\uccad \ud30c\ub77c\ubbf8\ud130\ub97c \uc0ac\uc6a9\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">function putData(url = &quot;&quot;, data = {}) {\n    fetch(url, {\n      method: &quot;PUT&quot;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n      body: JSON.stringify(data),\n    })\n\t\t.then((res) =&gt; res.json())\n\t\t.then((res) =&gt; console.log(res))\n\t  .catch((error)=&gt;console.log(error.message));\n}\n\nputData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n  id: 1,\n\ttitle: &quot;Put test&quot;,\n\tdata: &quot;fetch\uc758 Put \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n\tuserId: 1,\n});\n<\/code><\/pre>\n<p>**<br \/>\n\uc608\uc81c2. async\/await\uc744 \uc0ac\uc6a9\ud55c Fetch**<\/p>\n<pre><code class=\"language-javascript\">async function putData(url = &quot;&quot;, data = {}) {\n\t try {\n    const response = await fetch(url, {\n      method: &quot;PUT&quot;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n      body: JSON.stringify(data),\n    });\n    const res = await response.json();\n\t\tconsole.log(res);\n  } catch (error) {\n    console.log(error.message);\n  }\n}\n\nputData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n  id: 1,\n\ttitle: &quot;Put test&quot;,\n\tdata: &quot;fetch\uc758 Put \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n\tuserId: 1,\n});\n<\/code><\/pre>\n<p>**<br \/>\n\uc608\uc81c3. async\/await\uc73c\ub85c \ub9cc\ub4e0 \ud568\uc218\ub97c \ud638\ucd9c \ud6c4 then\uc73c\ub85c \uacb0\uacfc \ucd9c\ub825\ud55c Fetch**<\/p>\n<pre><code class=\"language-javascript\">async function putData(url = &quot;&quot;, data = {}) {\n  try {\n    const response = await fetch(url, {\n      method: &#39;PUT&#39;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n      body: JSON.stringify(data),\n    });\n    return response.json();\n  } catch (error) {\n    console.log(error.message);\n\t}\n}\n\nputData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n  id: 1,\n  title: &quot;Put test&quot;,\n  body: &quot;fetch\uc758 Put \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n  userId: 1,\n}).then((data) =&gt; {\n  console.log(data);\n});\n<\/code><\/pre>\n<p>\uc704 3\uac00\uc9c0 \uc608\uc81c\uc758 \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/11-4.png\" alt=\"\"><\/p>\n<h3>3.4 PATCH \uc694\uccad<\/h3>\n<h4>3.4.1 PATCH\ub780?<\/h4>\n<p>PATCH\ub780 \uc704\uc5d0 \uc0c1\uc220\ud55c \uac83\uacfc \uac19\uc774 \ub370\uc774\ud130\ub97c <strong>\ubd80\ubd84 \ubcc0\uacbd<\/strong> \ud574\uc8fc\ub294 HTTP \uba54\uc18c\ub4dc\uc774\ub2e4. PUT\ub3c4 \ub370\uc774\ud130\ub97c \ubcc0\uacbd\ud574\uc8fc\ub294 HTTP \uba54\uc18c\ub4dc\uc774\uc9c0\ub9cc, \ub370\uc774\ud130\ub97c \uc804\uccb4 \ubcc0\uacbd\ud574\uc8fc\uae30 \ub54c\ubb38\uc5d0 PATCH\uc640\ub294 \ubcc0\uacbd\ud558\ub294 \ub0b4\uc6a9\uc5d0 \ucc28\uc774\uac00 \uc788\ub2e4.<\/p>\n<h4>3.4.2 \uc0ac\uc6a9\ubc29\ubc95<\/h4>\n<p>\uc0ac\uc6a9 \ubc29\ubc95\uc740 \uc544\ub798\uc640 \uac19\uc774 \uc791\uc131\ud558\uba74 \ub41c\ub2e4. \uc989, fetch\ud568\uc218\uc5d0\uc11c method\ub97c PATCH\ub85c \uc785\ub825\ud574\uc8fc\uba74 \ub41c\ub2e4. \uc790\uc138\ud55c \uc0ac\uc6a9 \ubc29\ubc95\uc740 \uc544\ub798 \uc608\uc81c\ub97c \ud1b5\ud574 \uc0b4\ud3b4\ubcf4\uc790.<\/p>\n<pre><code class=\"language-javascript\">fetch(API_url,{method: &quot;PATCH&quot;})\n<\/code><\/pre>\n<h4>3.4.3 \uc2e4\uc2b5 \uc608\uc81c<\/h4>\n<p><strong>\uc608\uc81c1. \uc694\uccad \ud30c\ub77c\ubbf8\ud130\ub97c \uc0ac\uc6a9\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">function patchData(url = &quot;&quot;, data = {}) {\n\tfetch(url, {\n\t\tmethod: &quot;PATCH&quot;,\n\t\theaders: {\n\t\t\t&quot;Content-Type&quot;: &quot;application\/json&quot;,\n\t\t},\n\t\tbody: JSON.stringify(data),\n\t})\n\t.then((res) =&gt; res.json())\n\t.then((res) =&gt; console.log(res))\n\t.catch((error)=&gt;console.log(error.message));\n}\n\npatchData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n\ttitle: &quot;Patch test&quot;,\n});\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n        method: &quot;PATCH&quot;,\n        headers: { &quot;content-type&quot;: &quot;application\/json&quot; },\n        body: JSON.stringify({\n          title: &quot;fetch_patch test&quot;,\n        }),\n      })\n        .then((response) =&gt; response.json())\n        .then((data) =&gt; console.log(data));\n<\/code><\/pre>\n<p><strong>\uc608\uc81c2. async\/await\uc744 \uc0ac\uc6a9\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function patchData(url = &quot;&quot;, data = {}) {\n\ttry {\n\t\tconst response = await fetch(url, {\n\t\t\tmethod: &quot;PATCH&quot;,\n\t\t\theaders: {\n\t\t\t\t&quot;content-type&quot;: &quot;application\/json&quot;\n\t\t\t},\n\t\t\tbody: JSON.stringify(data),\n\t\t});\n\t\tconst res = await response.json();\n\t\tconsole.log(res);\n\t} catch (error) {\n\t\tconsole.log(error);\n\t}\n}\n\npatchData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n\ttitle: &quot;Patch test&quot;,\n});\n<\/code><\/pre>\n<p><strong>\uc608\uc81c3. async\/await\uc73c\ub85c\ub9cc\ub4e0 \ud568\uc218\ub97c \ud638\ucd9c \ud6c4 then\uc73c\ub85c \uacb0\uacfc \ucd9c\ub825\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function patchData(url = &quot;&quot;, data = {}) {\n  try {\n    const response = await fetch(url, {\n      method: &quot;PATCH&quot;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n      body: JSON.stringify(data),\n    });\n    return response.json();\n  } catch (error) {\n    console.log(error.message);\n  }\n}\n\npatchData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n  title: &quot;Patch test&quot;,\n}).then((data) =&gt; {\n  console.log(data);\n});\n<\/code><\/pre>\n<p>\ucf58\uc194\ucc3d\uc758 \uacb0\uacfc\ub97c \ud1b5\ud574 title\uc5d0 \ub300\ud55c \uac12\uc774 &quot;sunt aut facere repellat provident occaecati excepturi optio reprehenderit\u201d \uc5d0\uc11c &quot;Patch test&quot;\ub85c \ubcc0\uacbd(Update) \ub41c \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/13-2.png\" alt=\"\"><\/p>\n<h3>3.5 DELETE \uc694\uccad<\/h3>\n<h4>3.5.1 DELETE\ub780?<\/h4>\n<p>DELETE\ub294 <strong>\uc9c0\uc815\ud55c \ub9ac\uc18c\uc2a4\ub97c \uc0ad\uc81c<\/strong>\ud560 \ub54c \uc0ac\uc6a9\ud55c\ub2e4. \uc11c\ubc84\uc5d0 \uc800\uc7a5\ud560 \ub370\uc774\ud130\ub97c \uc804\ub2ec\ud558\uc9c0 \uc54a\uae30 \ub54c\ubb38\uc5d0 POST \ubc0f PUT\ubcf4\ub2e4 \ube44\uad50\uc801 \uac04\ub2e8\ud558\ub2e4.<\/p>\n<h4>3.5.2 \uc0ac\uc6a9\ubc29\ubc95<\/h4>\n<p>DELETE \uc694\uccad\uc744 \ub9cc\ub4dc\ub294 \uac83\uc740 POST \ubc0f PUT\uc640 \uc720\uc0ac\ud558\uba70, Fetch \ud638\ucd9c\uc5d0\uc11c \ub450 \ubc88\uc9f8 \uc778\uc218 \uc704\uce58\uc5d0 \uc788\ub294 \uac1d\uccb4\uc5d0 <code>DELETE<\/code> \ub97c \uc9c0\uc815\ud55c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">fetch(API_url, {method:&quot;DELETE&quot;})\n<\/code><\/pre>\n<h4>3.5.3 \uc608\uc81c<\/h4>\n<p>\uc2e4\uc2b5\uc5d0\uc11c \uc0ac\uc6a9\ud560 API \uc8fc\uc18c(<a href=\"https:\/\/jsonplaceholder.typicode.com\/posts\/1\">https:\/\/jsonplaceholder.typicode.com\/posts\/1<\/a>)\ub97c \ub4e4\uc5b4\uac00\uba74 \ub2e4\uc74c\uacfc \uac19\uc740 \ub370\uc774\ud130\ub97c \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-json\">{\n  &quot;userId&quot;: 1,\n  &quot;id&quot;: 1,\n  &quot;title&quot;: &quot;sunt aut facere repellat provident occaecati excepturi optio reprehenderit&quot;,\n  &quot;body&quot;: &quot;quia et suscipitnsuscipit recusandae consequuntur expedita et cumnreprehenderit molestiae ut ut quas totamnnostrum rerum est autem sunt rem eveniet architecto&quot;\n}\n<\/code><\/pre>\n<p>\uc704\uc758 \ub370\uc774\ud130\ub97c \ubc14\ud0d5\uc73c\ub85c posts\uc758 1\ubc88 \uac8c\uc2dc\ubb3c\uc744 \uc0ad\uc81c\ud558\ub294 \ub2e4\uc591\ud55c \uc608\uc81c\ub4e4\uc744 \uc0b4\ud3b4\ubcf4\uc790.<\/p>\n<p><strong>\uc608\uc81c1. \uc694\uccad \ud30c\ub77c\ubbf8\ud130\ub97c \uc0ac\uc6a9\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">function deleteData(url = &quot;&quot;) {\n    fetch(url, {\n      method: &quot;DELETE&quot;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n    })\n\t\t.then((res) =&gt; res.json())\n\t\t.then((res) =&gt; console.log(res))\n\t  .catch((error)=&gt;console.log(error.message));\n}\n\ndeleteData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;);\n<\/code><\/pre>\n<p><strong>\uc608\uc81c2. async\/await\uc744 \uc0ac\uc6a9\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function deleteData(url = &quot;&quot;) {\n\ttry {\n\t\tconst response = await fetch(url, {\n\t\t\tmethod: &quot;DELETE&quot;,\n\t\t\theaders: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n\t\t});\n\t\tconst res = await response.json();\n\t\tconsole.log(res);\n\t} catch (error) {\n\t\tconsole.log(error.message);\n\t}}\n\ndeleteData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;);\n<\/code><\/pre>\n<p><strong>\uc608\uc81c3. async\/await\uc73c\ub85c \ub9cc\ub4e0 \ud568\uc218\ub97c \ud638\ucd9c \ud6c4 then\uc73c\ub85c \uacb0\uacfc \ucd9c\ub825\ud55c Fetch<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function deleteData(url = &quot;&quot;) {\n  try {\n    const response = await fetch(url, {\n      method: &quot;DELETE&quot;,\n      headers: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      }\n    });\n    return response.json();\n  } catch (error) {\n    console.log(error.message);\n\t}\n}\n\ndeleteData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;)\n.then((data) =&gt; {\n  console.log(data);\n});\n<\/code><\/pre>\n<p>DELETE \uc694\uccad\uc744 \ud55c \ud6c4 \uacb0\uacfc\ub97c \ud655\uc778\ud588\uc744 \ub54c \ucf58\uc194\uc5d0 \uc544\ub798\uc758 \ub0b4\uc6a9\uc774 \ucd9c\ub825\ub41c\ub2e4\uba74 \uc131\uacf5\uc774\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/14-2.png\" alt=\"\"><\/p>\n<h2>4. Fetch\ub97c \ud1b5\ud55c API\ub97c \ubd88\ub7ec\uc624\ub294 \ubc29\ubc95<\/h2>\n<h3>4.1 API\ub780 \ubb34\uc5c7\uc77c\uae4c?<\/h3>\n<p>Wikipedia[1]\uc5d0\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \uc124\uba85\ud558\uace0 \uc788\ub2e4. <strong>API<\/strong>\ub780 \uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8 \ud504\ub85c\uadf8\ub798\ubc0d \uc778\ud130\ud398\uc774\uc2a4(Application Programming Interface)\uc774\ub2e4. \uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d, \uc6b4\uc601 \uccb4\uc81c\ub098 \ud504\ub85c\uadf8\ub798\ubc0d \uc5b8\uc5b4\uac00 \uc81c\uacf5\ud558\ub294 \uae30\ub2a5\uc744 \uc81c\uc5b4\ud560 \uc218 \uc788\uac8c \ub9cc\ub4e0 \uc778\ud130\ud398\uc774\uc2a4\ub97c \ub73b\ud55c\ub2e4. \uc8fc\ub85c \ud30c\uc77c \uc81c\uc5b4, \ucc3d \uc81c\uc5b4, \ud654\uc0c1 \ucc98\ub9ac, \ubb38\uc790 \uc81c\uc5b4 \ub4f1\uc744 \uc704\ud55c \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc81c\uacf5\ud55c\ub2e4. \uc774\ub860\uc801\uc778 \uc124\uba85\uc740 \uc5b4\ub824\uc6b0\ub2c8, \uadf8\ub9bc\uc744 \ubcf4\uba70 \uc27d\uac8c \uc774\ud574\ud574 \ubcf4\uc790.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/velog.velcdn.com\/images\/minyoungdumb\/post\/f7b0bc8f-0766-42d5-9160-f09f23d6aced\/image.png\" alt=\"API \uc608\uc2dc \uc2dc\uac01\ud654(1)\"><\/p>\n<p>\uc704 \uadf8\ub9bc\ucc98\ub7fc \uc190\ub2d8\uc740 \uc74c\uc2dd\uc744 \uba39\uae30 \uc704\ud574\uc120 4\ub2e8\uacc4\ub97c \uac70\uccd0\uc57c \ud55c\ub2e4. \uc190\ub2d8\uc774\u00a0<strong>\uc8fc\ubb38<\/strong>\uc744 \ud558\uba74, \uc6e8\uc774\ud130\ub294 \ub0c9\uc7a5\uace0\uc5d0\uc11c \uc74c\uc2dd\uc744\u00a0<strong>\ucc3e\ub294\ub2e4<\/strong>. \uc74c\uc2dd\uc744\u00a0<strong>\ucc3e\uc73c\uba74<\/strong>,\u00a0<strong>\uac00\uc838\uc624\uace0<\/strong>, \ub098\ub984\uc758 \uc870\ub9ac\ub97c \ud1b5\ud574\u00a0<strong>\uc11c\ube59<\/strong>\ud55c\ub2e4. API \ub3d9\uc791\ub3c4 \uc774\uc640 \ub9e4\uc6b0 \uc720\uc0ac\ud558\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/velog.velcdn.com\/images\/minyoungdumb\/post\/e3938059-4788-4b63-90bd-d7cd38814d75\/image.png\" alt=\"API \uc608\uc2dc \uc2dc\uac01\ud654(2)\"><\/p>\n<p>\uc704 \uadf8\ub9bc\uc744 \ud1b5\ud574 \ube0c\ub77c\uc6b0\uc800\uc640 \uc11c\ubc84, \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc758 \ub3d9\uc791\ub4e4\uc744 \ud558\ub098\uc529 \ub5bc\uc11c\u00a0\ube44\uad50\ud574 \ubcf4\uc790.\u00a0\uc6f9\ube0c\ub77c\uc6b0\uc800\ub294 \uc190\ub2d8\uc774 \uc74c\uc2dd\uc744 \uc694\uccad\ud558\ub294 \uac83\ucc98\ub7fc \ub370\uc774\ud130\ub97c\u00a0\uc694\uccad\ud55c\ub2e4. \uadf8\ub798\uc11c\u00a0\uc6f9\ube0c\ub77c\uc6b0\uc800\ub97c <strong>Client <\/strong>\ub77c\uace0 \ubd80\ub97c \uc218\u00a0\uc788\ub2e4. \uc11c\ubc84\ub294\u00a0\uc8fc\ubb38\ubc1b\uc740 \uc74c\uc2dd(\ub370\uc774\ud130)\ub97c\u00a0\uc804\ub2ec\ud574 \uc8fc\ub294\u00a0\uc5ed\ud560\uc744 \ud55c\ub2e4. \uadf8\ub9ac\uace0 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub294 \uc74c\uc2dd\ub4e4(\ub370\uc774\ud130\ub4e4)\uc774\u00a0\ubcf4\uad00\ub418\uc5b4 \uc788\ub294\u00a0\ub0c9\uc7a5\uace0\uc640 \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/velog.velcdn.com\/images\/minyoungdumb\/post\/c48895a9-9b3e-449f-81cb-754493c1ee02\/image.png\" alt=\"API \uc608\uc2dc \uc2dc\uac01\ud654(3)\"><\/p>\n<p>\ucd5c\uc885\uc801\uc73c\ub85c \uc704 \uadf8\ub9bc\uc5d0\uc11c <strong>Query<\/strong>\ub294 \uac80\uc0c9, \uc9c8\uc758\ub97c \ub73b\ud55c\ub2e4. \uc5ec\uae30\uc11c <strong>response<\/strong>\uc640 <strong>request<\/strong>\ub97c \uc798 \uae30\uc5b5\ud558\uc790. \uc790, \uadf8\ub7ec\uba74 \uad00\uc810\uc744 \ub098\ub204\uc5b4 \uc0dd\uac01\ud574\ubcf4\uc790. \uc6b0\uc120 <strong>Client <\/strong>\uad00\uc810\uc5d0\uc11c \uc0dd\uac01\ud558\uc790.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/15-3.png\" alt=\"API \uc694\uccad Client \uad00\uc810 \uc2dc\uac01\ud654\"><\/p>\n<p><strong>Client<\/strong> \uad00\uc810\uc5d0\uc11c\ub294\u00a0\ud074\ub77c\uc774\uc5b8\ud2b8\uc640 \uc11c\ubc84\ub2e8\uc5d0\uc11c \uadf8\ub9bc 4.4\uc758 <strong>Request(1)<\/strong>\uc640 <strong>Response(4)<\/strong>\uc5d0 \ub300\ud574\uc11c\ub9cc \uc54c\uba74 \ub41c\ub2e4. \uc774\ub807\uac8c <strong>Request<\/strong>\uc640 <strong>Response<\/strong> \uc989, \ub370\uc774\ud130\ub97c \uc694\uccad\ud558\uace0 \uc804\ub2ec\ubc1b\ub294 \uac83\uc744\u00a0<strong>API \ud638\ucd9c<\/strong>\uc774\ub77c\uace0\u00a0\ud55c\ub2e4. <strong>API<\/strong> \ub77c\ub294 \uac83\uc740 \uc27d\uac8c \ub9d0\ud574\uc11c \uc6f9\ube0c\ub77c\uc6b0\uc800\uc640\u00a0\uc11c\ubc84 \uac04\uc758\u00a0\uc0ac\uc774\ucc98\ub7fc \ud504\ub85c\uadf8\ub7a8\uacfc \ud504\ub85c\uadf8\ub7a8 \uc0ac\uc774\uc758\u00a0\uc5f0\uacb0 \ub2e4\ub9ac\uc774\uc790\u00a0\ub300\ud654\ub97c \ud560 \uc218 \uc788\ub294 \ubc29\ubc95\uc73c\ub85c \ubcfc \uc218 \uc788\ub2e4. \uc608\ub97c \ub4e4\uba74, \u201c<strong>API<\/strong>\ub97c \ud638\ucd9c\ud55c\ub2e4\u201d \ub77c\ub294 \ub73b\uc740 \u201c\ub2e4\ub978 \ud504\ub85c\uadf8\ub7a8\uc5d0\uc11c \ub370\uc774\ud130\ub97c \ubc1b\uae30 \uc704\ud574 \ub9d0\uc744 \uac74\ub2e4.\u201d \ub77c\uace0 \uc774\ud574 \ud560 \uc218 \uc788\ub2e4.<br \/>\n\uadf8\ub807\ub2e4\uba74 \uacb0\uad6d, <strong>API<\/strong>\ub97c \ud638\ucd9c\ud558\ub294 \uac83\uc740 \ub2e4\ub978\u00a0\ud504\ub85c\uadf8\ub7a8\uc73c\ub85c\ubd80\ud130\u00a0\ub370\uc774\ud130\ub97c \ubc1b\uae30 \uc704\ud55c \uc815\ud655\ud55c \ubaa9\uc801\uc774 \uc788\ub2e4\uace0 \ubcfc \uc218 \uc788\ub294\ub370 \uc774\uac74 \ud568\uc218\uc640 \ube44\uc2b7\ud558\ub2e4\uace0 \uc0dd\uac01\ud560 \uc218 \uc788\ub2e4. \ud568\uc218 \ub610\ud55c \ud638\ucd9c\uc744 \ud1b5\ud574 \uc6d0\ud558\ub294 \ub370\uc774\ud130\ub97c \ubc18\ud658\ubc1b\ub294\ub2e4. \ud558\uc9c0\ub9cc\u00a0<strong>API<\/strong> <strong>\ud638\ucd9c<\/strong>\uc774\u00a0\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc758 \ud568\uc218\uc640 \uac00\uc9c0\ub294 \uac00\uc7a5 \ud070 \ucc28\uc774\uc810\uc740 \uc751\ub2f5(<strong>Response<\/strong>)\ub97c \uc5b8\uc81c\u00a0\ubc1b\uc744\uc9c0\u00a0\ud655\uc2e4\ud788 \uc54c \uc218 \uc5c6\ub2e4\ub294 \uc810\uc774\ub2e4.<br \/>\n<strong>API<\/strong> <strong>\ud638\ucd9c<\/strong>\uc740\u00a0\ud56d\uc0c1 \ucef4\ud4e8\ud130 \ub0b4\uc5d0\uc11c \uc77c\uc5b4\ub098\uc9c0 \uc54a\ub294\ub2e4. <strong>Client <\/strong>\uc640 <strong>Server<\/strong> \ucef4\ud4e8\ud130\uac00 \ub2e4\ub97c \uc218 \uc788\uace0, \ubcf4\ud1b5 \ub2e4\ub978 \uacbd\uc6b0\uac00 \ub9ce\ub2e4. \uadf8\ub9ac\uace0 \ub370\uc774\ud130\ub97c \uc694\uccad\ud588\uc744 \ub54c,\u00a0<strong>Server<\/strong>\uc5d0\uc11c\u00a0\ub370\uc774\ud130\ub97c\u00a0\uc751\ub2f5\ud574 \uc8fc\ub294\u00a0\uc2dc\uac04\uc740 \uc778\ud130\ub137\uc758 \uc18d\ub3c4, \uc11c\ubc84\uc758 \ubd80\ud558 \uc0c1\ud0dc \ub4f1\uc73c\ub85c \uc608\uc0c1\ud560 \uc218 \uc5c6\uace0 \ub54c\ub85c\ub294 \uc2e4\ud328\ud558\uae30\ub3c4 \ud55c\ub2e4. \uadf8\ub798\uc11c \uc774\uc804\uc5d0 \ubc30\uc6b4 \u2018<strong>Promise<\/strong>\u2019 \uac1d\uccb4\uc5d0\u00a0\u2018<strong>Rejected<\/strong>\u2019 \ub77c\ub294\u00a0\uc0c1\ud0dc\uac00 \uc874\uc7ac\ud55c\ub2e4. \uadf8\ub798\uc11c\u00a0\uc5b8\uc81c \ub05d\ub0a0\uc9c0\u00a0\ubaa8\ub974\ub294 \uc774 \uc0c1\ud0dc\ub4e4\uc744 \ub3d9\uae30\uc801\uc73c\ub85c \ucc98\ub9ac\ud574\uc120\u00a0\uc548\ub418\ub294 \uc774\uc720\uac00 \uc131\ub9bd\ub41c\ub2e4. \uadf8\ub798\uc11c\u00a0API \ud638\ucd9c\uc744\u00a0<strong>Promise<\/strong> \uac1d\uccb4\ub97c \uc774\uc6a9\ud574 \ube44\ub3d9\uae30\uc801\uc73c\ub85c \ud638\ucd9c\ud558\uac8c \ub41c\ub2e4. <\/p>\n<h3>4.2 API \ud638\ucd9c\ud558\uae30<\/h3>\n<p>\uc774\uc81c \ud2b9\uc815 \uc11c\ubc84\uc5d0 \ub370\uc774\ud130\ub97c \uc694\uccad\ud558\uace0\u00a0<strong>API \ud638\ucd9c<\/strong>\ud558\ub294\u00a0\uc2e4\uc2b5\uc744\u00a0\uc9c4\ud589\ud574 \ubcf4\uc790.\u00a0<strong>API<\/strong>\ub97c \uc544\ubb34\ub807\uac8c\ub098 \ud638\ucd9c\ud574\uc120 \uc548\ub418\uace0 \uc778\uc99d\ub41c \uc0c1\ud0dc\uc758 \uc11c\ubc84\uc5d0 \ud638\ucd9c\uc744\u00a0\ud574\uc57c \ud55c\ub2e4.\u00a0<strong>{json}placeholder<\/strong><em>[2]<\/em>(API \uc5f0\uc2b5\uc6a9 \uc11c\ubc84,\u00a0\uc870\uac74 \uc5c6\uc774\u00a0\ub354\ubbf8 \ub370\uc774\ud130\ub97c\u00a0\uc81c\uacf5\ud574 \uc8fc\ub294\u00a0\uc11c\ube44\uc2a4 : OPEN API)\ub97c \uc774\uc6a9\ud574\u00a0\uc2e4\uc2b5\ud574 \ubcf4\uc790.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/velog.velcdn.com\/images\/minyoungdumb\/post\/6523b2a8-5560-4788-b430-c4ad97242d32\/image.png\" alt=\"{json}placeholder \uc6f9\uc0ac\uc774\ud2b8 \ub0b4\uc758 Resources \ud30c\ud2b8\"><\/p>\n<p>\ud398\uc774\uc9c0 \ub0b4\uc5d0\uc11c \uc2a4\ud06c\ub864\uc744 \ub0b4\ub9ac\uba74 \uadf8\ub9bc 4.5\uc640 \uac19\uc774 \u201cResource\u201d \ud30c\ud2b8\uac00 \ubcf4\uc77c \uac83\uc774\ub2e4. \uc5ec\uae30\uc11c \u201c\/posts\u201d\ub97c \ud074\ub9ad\ud558\uba74 \uc544\ub798 \uadf8\ub9bc\uacfc \uac19\uc740 \uac1d\uccb4 \ud615\uc2dd\uc744 \uc9c0\ub2cc <strong>json<\/strong> \ub370\uc774\ud130 \ub9ac\uc2a4\ud2b8\ub97c \ud655\uc778\ud560 \uc218 \uc788\ub2e4. <strong>response<\/strong> \uc989, \uc751\ub2f5\uac12\uc744 <strong>json<\/strong> \ud615\ud0dc\ub85c \ubc18\ud658\ud558\uace0 \uc788\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. (<strong>json<\/strong> \ub370\uc774\ud130\uc758 \ubaa8\uc2b5\uc774 \uc815\ub82c\ub418\uc5b4\uc788\uc9c0 \uc54a\uc740 \uacbd\uc6b0, chrome extension \u201cJSON View\u201d\ub97c \ub2e4\uc6b4\ubc1b\uc544 \uc0ac\uc6a9\ud558\uba74 \uadf8\ub9bc 4.6\uacfc \uac19\uc774 \uc815\ub82c\ub41c \ub370\uc774\ud130\ub97c \ud655\uc778\ud560 \uc218 \uc788\ub2e4.)<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/velog.velcdn.com\/images\/minyoungdumb\/post\/e5fbdd6d-a23b-4c8b-8e47-020cb47be942\/image.png\" alt=\"&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot; \uc811\uc18d \uc2dc \ub098\ud0c0\ub098\ub294 json \ub370\uc774\ud130\"><\/p>\n<p>\uadf8\ub807\ub2e4\uba74, \uc774 <strong>json<\/strong> \ud30c\uc77c\uc744 \ubd88\ub7ec\uc640 \ubcf4\uc790.<\/p>\n<pre><code class=\"language-text\">&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;\n<\/code><\/pre>\n<p><strong>API<\/strong> \ub97c \ud638\ucd9c\ud558\uae30 \uc704\ud574\uc120 <strong>URL\uc8fc\uc18c<\/strong>\ub97c \uc54c\uc544\uc57c \ud55c\ub2e4. <strong>URL\uc8fc\uc18c<\/strong>\ub294 \uc704 \ucf54\ub4dc \ube14\ub7ed\uacfc \uac19\ub2e4. \uc704\uc640 \uac19\uc740 \uc8fc\uc18c\ub85c \ub9d0\uc744 \uac78\uaca0\ub2e4\ub77c\ub294 \uc758\ubbf8\uc774\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">let response = fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;);\n\/\/ response\ub77c\ub294 \ubcc0\uc218\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4 -&gt; let response: Promise&lt;Response&gt;\n<\/code><\/pre>\n<p>\uadf8\ub7fc \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\ub85c <strong>API<\/strong> \ub97c \ud638\ucd9c\ud574\ubcf4\uc790. \uc704 \ucf54\ub4dc\uc640 \uac19\uc774, \uc751\ub2f5\uc744 <strong>response<\/strong> \ub77c\ub294 \ubcc0\uc218\uc5d0 \uc800\uc7a5\ud558\uaca0\ub2e4. <strong>fetch<\/strong> \ub77c\ub294 \ub0b4\uc7a5\ud568\uc218\ub97c \uc0ac\uc6a9\ud588\ub2e4. <strong>fetch<\/strong>\ub294 <strong>API<\/strong>\ub97c \ud638\ucd9c\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc8fc\ub294 \ube44\ub3d9\uae30 JavaScript \ub0b4\uc7a5\ud568\uc218\uc774\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">let response = fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;)\n\t.then((res) =&gt; console.log(res));\n<\/code><\/pre>\n<p><strong>Promise<\/strong>\ub97c \ubc18\ud658\ud558\ub294 \ud568\uc218\ub294 \ube44\ub3d9\uae30 \ucc98\ub9ac\ub97c \ud558\ub294 \ud568\uc218\uc774\ub2e4. \uadf8\ub9ac\uace0, \uc774 \ud568\uc218\uc758 \ucc98\ub9ac\uacb0\uacfc\ub294 <strong>then<\/strong>\uc744 \ud1b5\ud574\uc11c \ucc98\ub9ac\uac00 \uac00\ub2a5\ud558\ub2e4.<br \/>\n\uc704 \ucf54\ub4dc\ub97c \ud06c\ub86c\u00a0\uac1c\ubc1c\uc790 \ub3c4\uad6c\uc758\u00a0\ucf58\uc194 \ucc3d\uc5d0\u00a0\uc2e4\ud589\ud574 \ubcf4\uc790.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/16-2.png\" alt=\"\ucf58\uc194\ucc3d\uc5d0 \uc608\uc81c \ucf54\ub4dc 4.3 \ub97c \uc785\ub825\ud588\uc744 \uacbd\uc6b0 \ub098\ud0c0\ub098\ub294 \uacb0\uacfc\uac12\"><\/p>\n<p>\uc704 \ucf58\uc194 \ucc3d\uacfc \uac19\uc774 \uc131\uacf5\ub41c \uc0c1\ud0dc\uac12\uc778 \u201cstatus:200\u201d\uc744 \uac00\uc838\uc624\ub294 \uac83\uc744 \uc54c \uc218 \uc788\ub2e4. \uadf8\ub7f0\ub370, \uc815\ub9d0 \ub9ce\uc740 \ub370\uc774\ud130\ub4e4\uc744 \ubd88\ub7ec\uc624\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. \uadf8 \uc774\uc720\ub294 <strong>fetch<\/strong>\ub97c \ud1b5\ud574 \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc624\uac8c \ub418\uba74, \ub370\uc774\ud130\uc758 \uacb0\uacfc\uac12\uc744 \ubc18\ud658\ud558\ub294 \uac8c \uc544\ub2c8\ub77c \uadf8 <strong>API<\/strong>\uc758 \uac1d\uccb4 \uc790\uccb4\ub97c \ubc18\ud658\ud558\uae30 \ub54c\ubb38\uc5d0 <strong>Response<\/strong>\ub77c\ub294 \uac1d\uccb4\ub97c \ubc18\ud658\ud558\uac8c \ub41c\ub2e4. \uc6b0\ub9ac\uac00 \ud3b8\uc9c0\ub97c \ubcf4\ub0c8\ub2e4\uace0 \uc608\ub97c \ub4e4\uc5b4\ubcf4\uc790. \ud604\uc7ac <strong>fetch<\/strong>\ub97c \ud1b5\ud574 \ubd88\ub7ec\uc628 \uac83\uc740 \ud3b8\uc9c0\uc640 \ub0b4\uc6a9\ubb3c\uc744 \uac10\uc2fc \ud3b8\uc9c0 \ubd09\ud22c\ub77c\uace0 \ubcf4\uba74\ub41c\ub2e4. \uc989, \uacb0\uacfc\uac12\uc758 \ud3ec\uc7a5\uc9c0\uc774\ub2e4. \uadf8\ub807\ub2e4\uba74, <strong>json<\/strong> \ub370\uc774\ud130 \ud30c\uc77c\uc5d0\uc11c \uc6d0\ud558\ub294 \ub370\uc774\ud130\ub97c \uac00\uc838\uc640\ubcf4\uc790.\uc774\ubc88\uc5d0\ub294 <strong>async<\/strong>, <strong>await<\/strong>\uc744 \uc0ac\uc6a9\ud574\ubcf4\uaca0\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">async function getData() {\n  let rawResponse = await fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;);\n}\n<\/code><\/pre>\n<p>\uc704 \ucf54\ub4dc\ucc98\ub7fc <strong>fetch<\/strong>\ub97c \uc774\uc6a9\ud574 <strong>getData<\/strong> \ud568\uc218\ub97c \ub9cc\ub4e4\uc5c8\ub2e4. \ubcc0\uc218\uba85\uc774 \u201crawResponse\u201d\uc778 \uc774\uc720\ub294 \uc704 \uadf8\ub9bc\ucc98\ub7fc \u201cResponse\u201d\ub77c\ub294 rawData\uac00 \ub0a0\uc544\uc624\uae30 \ub54c\ubb38\uc774\ub2e4. \uadf8\ub7ec\uba74 <strong>json<\/strong> \ub370\uc774\ud130\ub9cc \uac00\uc838\uc640\ubcf4\uae30\ub85c \ud558\uc790.<\/p>\n<pre><code class=\"language-javascript\">async function getData() {\n  let rawResponse = await fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;);\n  let jsonResponse = await rawResponse.json();\n  console.log(jsonResponse);\n}\n\ngetData();\n<\/code><\/pre>\n<p><strong>json<\/strong> \ub370\uc774\ud130\ub9cc \uac00\uc838\uc624\uae30 \uc704\ud574\uc11c\ub294 <strong>fetch<\/strong> <strong>API<\/strong>\uc5d0 \ub0b4\uc7a5\ub41c\u00a0\uba54\uc11c\ub4dc\uc778\u00a0\u201c<strong>json()<\/strong>\u201d\ub97c\u00a0\uc0ac\uc6a9\ud574 \uc8fc\uc5b4\uc57c\u00a0\ud55c\ub2e4. \ubd88\ub7ec\uc628 \uc804\uccb4 \ub370\uc774\ud130(\u201drawResponse\u201d)\uc5d0\uc11c <strong>json()<\/strong>\uc744 \ubd99\uc5ec\uc900 \uac83\uc744 \u201cjsonResponse\u201d\ub77c\ub294 \ubcc0\uc218\uc5d0 \ub2f4\uc544 \ucf58\uc194\uc5d0\u00a0\ucd9c\ub825\ud574 \ubcf4\uc790.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/17-2.png\" alt=\"\uc704 \uc608\uc81c \ucf54\ub4dc\ub97c \uc2e4\ud589\ud55c \uacb0\uacfc\uc758 \ucf58\uc194 \ucc3d\"><\/p>\n<p>\uacb0\uad0f\uac12\uc740 \uc704 \ucf58\uc194 \ucc3d\uacfc \uac19\ub2e4. \ubc30\uc5f4\uc5d0 100\uac1c\uc758 \ub370\uc774\ud130\uac00 \ub2f4\uaca8 \ub0a0\uc544\uc654\ub2e4. \uadf8\ub9ac\uace0 \ud558\ub098\uc529 \uae4c\ubcf4\uba74 \ub370\uc774\ud130\uac00 \uc815\uc0c1\uc801\uc73c\ub85c \uc798 \ub4e4\uc5b4\uc640\uc788\uc74c\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. \uc774\ub7f0 \uc2dd\uc73c\ub85c fetch\ub97c \ud1b5\ud574 API\ub97c \ud638\ucd9c\ud558\ub294 \uae30\ubcf8\uc801\uc778 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uc558\ub2e4.<\/p>\n<h3>4.3 GET, POST \uc0ac\uc6a9\ud574\ubcf4\uae30<\/h3>\n<p>\uc774\ubc88\uc5d0\ub294 \u201cget\u201d \ubc29\uc2dd\uacfc \u201cpost\u201d \ubc29\uc2dd\uc744 \uc0ac\uc6a9\ud558\uba74\uc11c API\ub97c \uc774\uc6a9\ud574 \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc640\ubcf4\uc790. API\ub294 \uc704\uc758 \uc608\uc2dc\ub4e4\uacfc \uac19\uc774 &quot;{json} placeholder&quot;\ub77c\ub294 \ud398\uc774\uc9c0\ub97c \uc774\uc6a9\ud558\uc9c0\ub9cc, \uc774\ubc88\uc5d4 \u201c\/posts\u201d \uac00 \uc544\ub2cc \u201c\/todos\u201d \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud574 \ubcf4\uc790.<\/p>\n<pre><code class=\"language-javascript\">fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/todos\/1&quot;)\n  .then(response =&gt; response.json())\n  .then(data =&gt; console.log(data))\n<\/code><\/pre>\n<p>\uc704\uc640 \uac19\uc774, \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc628\ub2e4. \u201cdefault\u201d \uc989, \uae30\ubcf8\uac12\uc740 <strong>get<\/strong>\ubc29\uc2dd\uc774\ub2e4. \uc21c\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<ol>\n<li>fetch\ub97c \uc774\uc6a9\ud574 todos\uc758 1\ubc88 \uac1d\uccb4 \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc628\ub2e4.<\/li>\n<li>then \uba54\uc11c\ub4dc\ub97c \ud1b5\ud574 \uc751\ub2f5 \uac12\uc744 json \ud615\uc2dd\uc73c\ub85c \ubcc0\ud658\ud55c\ub2e4.<\/li>\n<li>then \uba54\uc11c\ub4dc\ub97c \ud1b5\ud574 \uadf8 \uac12(data)\uc744 console\uc5d0 \ucd9c\ub825\ud55c\ub2e4.<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/velog.velcdn.com\/images\/minyoungdumb\/post\/c33dcfaa-8f58-454d-810a-b759b6aecec1\/image.png\" alt=\"\uc704 \uc608\uc81c \ucf54\ub4dc\uc758 \uacb0\uacfc\uc758 \ucf58\uc194 \ucc3d\"><\/p>\n<p>\ub2e4\uc74c\uacfc \uac19\uc774 \ub370\uc774\ud130\ub97c \uc798 \ubd88\ub7ec\uc624\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. \uadf8\ub807\ub2e4\uba74, \uc774\ubc88\uc5d4 <strong>POST<\/strong> \ubc29\uc2dd\uc73c\ub85c \ub370\uc774\ud130\ub97c \uc804\ub2ec\ud574 \ubcf4\uc790. <strong>POST<\/strong> \ubc29\uc2dd\uc5d0\uc11c\ub294 \u201c<strong>fetch(\u2019URL\u2019, {})<\/strong>\u201d\ucc98\ub7fc URL\ub4a4\uc758 \ub450 \ubc88\uc9f8 \uc778\uc790\ub3c4 \uc911\uc694\ud558\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;, {\n    method: &#39;POST&#39;,\n    headers:{\n\t\t\t&quot;Content-Type&quot; : &quot;application\/json&quot;\n\t\t},\n    body: JSON.stringify({\n        title: &quot;foo&quot;,\n        body: &quot;bar&quot;,\n        userId: 1,\n    })\n})\n<\/code><\/pre>\n<p>\uc11c\ubc84\uc5d0\uc11c \uc6b0\ub9ac\uac00 \uc5bb\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130\uac00 <strong>json <\/strong>\ud615\ud0dc\uc778\uc9c0 \uc54c\uae30 \uc704\ud574\uc11c, <strong>method<\/strong>\uc640 <strong>headers<\/strong>\ub97c \uc54c\ub9de\uac8c \uae30\uc785\ud574 \uc8fc\uc5b4\uc57c \ud55c\ub2e4. <strong>body<\/strong>\uc5d0 JSON \uba54\uc11c\ub4dc\uc778 \u201cJSON.stringify()\u201d\ub97c \ud1b5\ud574 \ub370\uc774\ud130\ub97c <strong>json<\/strong> \ubb38\uc790\uc5f4 \ud615\uc2dd\uc73c\ub85c \uaf2d \ubcc0\ud658\ud574\uc11c \ubcf4\ub0b4\uc8fc\uc5b4\uc57c \ud55c\ub2e4. \uadf8\ub9ac\uace0 \uacb0\uacfc\ub97c \ud655\uc778\ud574 \ubcf4\uc790.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/velog.velcdn.com\/images\/minyoungdumb\/post\/0bb2f443-a44e-4e1b-8d87-90a9707bbda6\/image.png\" alt=\"\uc704 \uc608\uc81c \ucf54\ub4dc\ub97c \uc2e4\ud589\ud55c \uacb0\uacfc\uc758 \ucf58\uc194 \ucc3d\"><\/p>\n<p>\uc704 \ucf58\uc194 \ucc3d\uacfc \uac19\uc774 <strong>fetch<\/strong> \ud568\uc218\ub97c \uc0ac\uc6a9\ud55c \uacb0\uacfc\uac00 \ucf58\uc194 \ucc3d\uc5d0 \ub098\ud0c0\ub0c8\ub2e4. <strong>http \uc0c1\ud0dc \ucf54\ub4dc 201<\/strong>\uc740 \u201c\uc131\uacf5\uc801\uc73c\ub85c \uc694\uccad\ub418\uc5c8\uc73c\uba70 \uc11c\ubc84\uac00 \uc0c8 \ub9ac\uc18c\uc2a4\ub97c \uc791\uc131\ud588\ub2e4\u201d\ub77c\uace0 \uc774\ud574\ud558\uba74 \ub41c\ub2e4. \uadf8\ub807\ub2e4\uba74, <strong>POST<\/strong>\ub85c \uc11c\ubc84\uc5d0 \ubcf4\ub0b8 \uc6b0\ub9ac\uc758 \ub370\uc774\ud130\uac00 \uc798 \uc788\ub294\uc9c0 \ud655\uc778\ud574 \ubcf4\uc790.<\/p>\n<pre><code class=\"language-javascript\">fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;, {\n    method: &#39;POST&#39;,\n    headers:{&quot;Content-Type&quot; : &quot;application\/json&quot;},\n    body: JSON.stringify({\n        title: &quot;foo&quot;,\n        body: &quot;bar&quot;,\n        userId: 1,\n    })\n  })\n\t.then(res =&gt; res.json())\n  .then(data =&gt; console.log(data))\n<\/code><\/pre>\n<p>\uc704 \ucf54\ub4dc\uc5d0 \ub354\ud558\uc5ec, <strong>GET <\/strong>\ubc29\uc2dd\uacfc \ub9c8\ucc2c\uac00\uc9c0\ub85c, \uc751\ub2f5 \uac12\uc744 <strong>json <\/strong>\ud615\uc2dd\uc73c\ub85c \ubc14\uafb8\uace0, \uadf8 \ub370\uc774\ud130\ub97c \ucf58\uc194\uc5d0 \ubd88\ub7ec\uc624\uba74 \ub41c\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/velog.velcdn.com\/images\/minyoungdumb\/post\/55244896-f9e0-4124-8c26-d7b74b0bd540\/image.png\" alt=\"\uc704 \uc608\uc81c \ucf54\ub4dc\ub97c \uc2e4\ud589\ud55c \uacb0\uacfc\uc758 \ucf58\uc194 \ucc3d\"><\/p>\n<p>\uacb0\uacfc\ub294 \uc704\uc640 \uac19\uc774 \uc798 \ub098\uc624\ub294 \uac83\uc744 \ubcfc \uc218 \uc788\uace0, \uc11c\ubc84\uc5d0\uc11c <strong>id<\/strong> \uac12\uc744 <strong>101<\/strong>\ub85c \ubd80\uc5ec\ud55c \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n<h2>5. Fetch \uc131\uacf5 \uc5ec\ubd80 \ud655\uc778 \ubc0f \uc5d0\ub7ec\ucc98\ub9ac<\/h2>\n<h3>5.1 Fetch \uc131\uacf5 \uc5ec\ubd80 \ud655\uc778<\/h3>\n<p>fetch\ub97c \uc0ac\uc6a9\ud560 \ub54c \uc8fc\uc758\ud560 \uc810\uc774 \uc788\ub2e4. \ub2e4\uc74c \uc608\uc81c\ub97c \uc0b4\ud3b4\ubcf4\uace0 \uacb0\uacfc\ub97c \uc608\uce21\ud574\ubcf4\uc790.<\/p>\n<pre><code class=\"language-javascript\">fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/no-exist&quot;)\n\t.then(() =&gt; console.log(&quot;ok&quot;))\n\t.catch(() =&gt; console.log(&quot;error&quot;));\n\n\/\/ GET https:\/\/jsonplaceholder.typicode.com\/no-exist 404\n\/\/ ok\n<\/code><\/pre>\n<p>\uc704 \uc608\uc81c\uc5d0\uc11c\ub294 \uc874\uc7ac\ud558\uc9c0 \uc54a\ub294 URL\uc774 \uc0ac\uc6a9\ub418\uc5c8\uae30 \ub54c\ubb38\uc5d0 404 \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud558\uace0 catch\uc5d0 \uc758\ud574 \u2018error\u2019\uac00 \ucd9c\ub825\ub420 \uac83\uc73c\ub85c \uc608\uc0c1\ub418\uc9c0\ub9cc \u2018ok\u2019\uac00 \ucd9c\ub825\ub41c\ub2e4. \ubaa8\ub4e0 \uc5d0\ub7ec\uac00 catch\uc5d0\uc11c \ucc98\ub9ac\ub418\uba74 \uc88b\uaca0\uc9c0\ub9cc \uadf8\ub807\uc9c0 \uc54a\ub2e4. HTTP \uc694\uccad\uc744 \ubcf4\ub0bc \uc218 \uc5c6\ub294 \uc0c1\ud0dc, \uc989 <strong>\ub124\ud2b8\uc6cc\ud06c \uc7a5\uc560\ub098 CORS \uc5d0\ub7ec\uc5d0 \uc758\ud574 \uc694\uccad\uc774 \uc644\ub8cc\ub418\uc9c0 \ubabb\ud55c \uacbd\uc6b0\uc5d0\ub9cc catch\uc5d0\uc11c \u2018error\u2019\ub97c \ucd9c\ub825\ud55c\ub2e4. <\/strong>\uadf8\ub798\uc11c \uc704\uc640 \uac19\uc740 \ubc29\uc2dd\uc73c\ub85c\ub294 404 \uc5d0\ub7ec\uc640 500 \uc5d0\ub7ec(\ub0b4\ubd80 \uc11c\ubc84 \uc624\ub958)\ub97c \ud310\ub2e8\ud560 \uc218 \uc5c6\ub2e4.<\/p>\n<blockquote>\n<p><strong>Info<\/strong>: \ud83d\udca1 CORS\ub780 Cross-Origin Resource Sharing(\uad50\ucc28 \ucd9c\ucc98 \uc790\uc6d0 \uacf5\uc720\ubc29\uc2dd)\uc758 \uc57d\uc790\ub85c, \uc11c\ub85c \ub2e4\ub978 \ucd9c\ucc98 \uac04\uc5d0 \ub9ac\uc18c\uc2a4\ub97c \uacf5\uc720\ud558\ub294 \uac83\uc744 \uc758\ubbf8\ud55c\ub2e4. \ub3c4\uba54\uc778, \ud504\ub85c\ud1a0\ucf5c, \ud3ec\ud2b8 \uc911 \ud558\ub098\ub77c\ub3c4 \ub2e4\ub974\uba74 \uc11c\ub85c \ub2e4\ub978 \ucd9c\ucc98\uc774\uba70, \ucd94\uac00\uc801\uc778 \ud5e4\ub354\ub97c \uc0ac\uc6a9\ud574 \ub2e4\ub978 \ucd9c\ucc98\ub85c \uc811\uadfc\ud560 \uc218 \uc788\ub294 \uad8c\ud55c\uc744 \ubd80\uc5ec\ubc1b\ub294\ub2e4.<\/p>\n<\/blockquote>\n<p>fetch \ud568\uc218\ub97c \uc0ac\uc6a9\ud560 \ub54c\ub294 \uc544\ub798\uacfc \uac19\uc774 fetch \ud568\uc218\uac00 \ubc18\ud658\ud55c ok \uc0c1\ud0dc\ub97c \ud655\uc778\ud574 \uc5d0\ub7ec\ub97c \ucc98\ub9ac\ud574\uc57c \ud55c\ub2e4. Response \uac1d\uccb4\uc758 ok\uc5d0\ub294 \uc694\uccad\uc5d0 \ub300\ud55c \uc751\ub2f5\uc774 \uc131\uacf5\ud588\ub294\uc9c0 \uc5ec\ubd80, \uc989 \uc0c1\ud0dc\ucf54\ub4dc 200\ubc88\ub300 \uc5ec\ubd80\ub97c \ub098\ud0c0\ub0b4\ub294 \ubd88\ub9ac\uc5b8(boolean) \uac12\uc774 \ub2f4\uaca8\uc788\ub2e4. Response\uc758 ok \uac12\uc774 true\uac00 \uc544\ub2c8\ub77c\uba74 throw \ubb38\uc744 \ud1b5\ud574 \uc5d0\ub7ec \uac1d\uccb4\ub97c \ub358\uc838 404 \uc5d0\ub7ec\uc640 500 \uc5d0\ub7ec\ub97c \ucc98\ub9ac\ud560 \uc218 \uc788\uac8c \ub41c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/no-exist&quot;)\n\t.then(response =&gt; {\n\t\tif (!response.ok) throw new Error(&quot;404 or 500 error&quot;);\n\t\treturn response.json();\n\t})\n\t.then(users =&gt; console.log(users))\n\t.catch(error =&gt; console.log(error));\n\n\/\/ GET https:\/\/jsonplaceholder.typicode.com\/no-exist 404\n\/\/ Error: 404 or 500 error\n<\/code><\/pre>\n<p>\uc704 \uc608\uc81c\uc758 Response \uac1d\uccb4\uc5d0 \uc5b4\ub5a4 \ub0b4\uc6a9\uc774 \uc788\ub294\uc9c0 \ud655\uc778\ud558\uae30 \uc704\ud574 \ucf58\uc194 \ucc3d\uc5d0 \uc544\ub798 \ucf54\ub4dc\ub97c \uc785\ub825 \ud6c4 \uacb0\uacfc\ub97c \ud655\uc778\ud574\ubcf4\uc790.<\/p>\n<pre><code class=\"language-javascript\">fetch(&quot;https:\/\/jsonplaceholder.typicode.com\/no-exist&quot;)\n\t.then(response =&gt; {\n\t\tif (!response.ok) return console.log(response);\n\t})\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/18-2.png\" alt=\"Response \uac1d\uccb4\uc758 ok \uc0c1\ud0dc \ud655\uc778\ud558\uae30\"><\/p>\n<p>Response \uac1d\uccb4\uc758 ok \uc0c1\ud0dc\uac00 false\uc778 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. \uc774\ucc98\ub7fc fetch \ud568\uc218\ub294 HTTP \uc5d0\ub7ec \uc0c1\ud0dc\ub97c reject\ud558\uc9c0 \uc54a\ub294 \ub300\uc2e0 \uc751\ub2f5\uc758 \uc0c1\ud0dc\uac00 200\ubc88\ub300\ub97c \ubc97\uc5b4\ub0a0 \uacbd\uc6b0 ok \uc18d\uc131\uc774 false\ub85c \ubc18\ud658\ub418\ub294 \uc18d\uc131\uc774 \uc788\uc5b4 \uc774\ub97c \ud65c\uc6a9\ud574 \uc5d0\ub7ec\ub97c \ucc98\ub9ac\ud560 \uc218 \uc788\ub2e4.<\/p>\n<h3>5.2 \uc5d0\ub7ec \ucc98\ub9ac<\/h3>\n<p>\uc5d0\ub7ec\ub294 \uadf8 \ubc1c\uc0dd \uc2dc\uc810\uc5d0 \ub530\ub77c \u2018\ucef4\ud30c\uc77c \uc5d0\ub7ec\u2019\uc640 \u2018\ub7f0\ud0c0\uc784 \uc5d0\ub7ec\u2019\ub85c \ubd84\ub958\ub41c\ub2e4. \u2018\ucef4\ud30c\uc77c \uc5d0\ub7ec\u2019\ub294 \ucf54\ub4dc\uac00 \ucef4\ud30c\uc77c(Compile) \ub420 \ub54c \ucef4\ud30c\uc77c\ub7ec\uac00 \ud574\uc11d\ud558\uc9c0 \ubabb\ud574\uc11c \ubc1c\uc0dd\ud558\ub294 \uc5d0\ub7ec\uc774\uace0 \u2018\ub7f0\ud0c0\uc784 \uc624\ub958\u2019\ub294 \ud504\ub85c\uadf8\ub7a8\uc774 \ub3d9\uc791\ud560 \ub54c \ubc1c\uacac\ud560 \uc218 \uc788\ub294 \uc5d0\ub7ec\ub2e4. \uc774\uc911 \u2018\ub7f0\ud0c0\uc784 \uc624\ub958\u2019\ub97c \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc5d0\uc11c \u2018\uc608\uc678(Exception)\u2019\ub77c\uace0\ub3c4 \ubd80\ub978\ub2e4.<br \/>\n\uc5d0\ub7ec\ub97c \ucc98\ub9ac\ud558\uae30 \uc704\ud574 \uc6b0\uc120 if \ubb38\uc744 \ud1b5\ud574 \uc5d0\ub7ec\ub97c \uac1c\ubcc4\uc801\uc73c\ub85c \ucc98\ub9ac\ud558\ub294 \ubc29\ubc95\uc774 \uc788\uc744 \uac83\uc774\ub2e4. \ud558\uc9c0\ub9cc if \ubb38\uc73c\ub85c \ud55c \uc5d0\ub7ec\ub97c \ucc98\ub9ac\ud588\ub2e4\uace0 \ud558\ub354\ub77c\ub3c4 \ub610 \uc5b4\ub5a4 \uc624\ub958\uac00 \uc0dd\uae38\uc9c0 \uc608\uce21\ud558\uae30 \uc5b4\ub835\ub2e4. \uc774\ub7ec\ud55c \uc608\uce21\ubd88\uac00\ub2a5\uc131\uc740 \ud504\ub85c\uadf8\ub7a8 \uac15\uc81c \uc885\ub8cc\ub85c \uc774\uc5b4\uc9c0\uae30\ub3c4 \ud55c\ub2e4. \uadf8\ub798\uc11c \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\ub294 \uc774\ub7ec\ud55c \uc0c1\ud669\uc744 \uc608\ubc29\ud558\uae30 \uc704\ud574 \uc608\uc678 \ucc98\ub9ac(Exception handling) \uc7a5\uce58\ub85c <code>try catch finally<\/code>\ub97c \ub9c8\ub828\ud588\ub2e4.  <code>try catch finally<\/code>\ub294<strong> \uc5d0\ub7ec \ucc98\ub9ac\ub97c \uc704\ud55c \ucf54\ub4dc\ub97c \ubbf8\ub9ac \ub4f1\ub85d\ud574 \ub450\uace0, \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud558\uba74 \uc5d0\ub7ec \ucc98\ub9ac \ucf54\ub4dc\ub85c \ub118\uc5b4\uac00\ub3c4\ub85d \ud558\ub294 \uc5d0\ub7ec \ucc98\ub9ac \ubc29\ubc95<\/strong>\uc774\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">try {\n\t\/\/ (1) \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud560 \uc218 \uc788\ub294 \ucf54\ub4dc\n} catch (error) {\n\t\/\/ (2) \uc5d0\ub7ec \ubc1c\uc0dd \uc2dc \ucf54\ub4dc\n} finally {\n\t\/\/ (3) \ubb34\uc870\uac74 \ud55c\ubc88 \uc2e4\ud589\ub418\ub294 \ucf54\ub4dc\n} \n\n\/\/ \uc774\ud6c4 \ub3d9\uc791\n<\/code><\/pre>\n<p>try \ucf54\ub4dc\ube14\ub85d\uc778 (1)\uc5d0\uc11c\ub294 \uc5d0\ub7ec\uac00 \ub098\ub354\ub77c\ub3c4 \ud504\ub85c\uadf8\ub7a8\uc774 \uac15\uc81c\uc885\ub8cc \ub418\uc9c0 \uc54a\uace0 catch \ucf54\ub4dc\ube14\ub85d\uc778 (2)\uac00 \uc2e4\ud589\ub41c\ub2e4. \uc989 (1)\uc5d0\uc11c \uc608\uc678\uc0c1\ud669\uc774 \ubc1c\uc0dd\ud558\uba74 (2)\uc5d0\uc11c \ud574\ub2f9 \uc608\uc678 \uc0c1\ud669\uc5d0 \ub300\ud55c \ub3d9\uc791\uc744 \uc2e4\ud589\ud558\uace0, \uc608\uc678 \uc0c1\ud669\uc774 \ubc1c\uc0dd\ud558\ub294\uc9c0 \uc5ec\ubd80\uc5d0 \uc0c1\uad00 \uc5c6\uc774 finally \ucf54\ub4dc\ube14\ub85d\uc778 (3)\uc774 \ub9c8\uc9c0\ub9c9\uc73c\ub85c \uc2e4\ud589\ub41c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">function follower() {\n    const followerCount = 100;\n    \n    try {\n        followerCount = 150;          \/\/ \ubcc0\uacbd\ud560 \uc218 \uc5c6\ub294 \uac12 \uc218\uc815 \uc2dc\ub3c4\n\t\t\t\tconsole.log(&#39;skip&#39;);          \/\/ \uc2e4\ud589\ub418\uc9c0 \uc54a\uc74c\n    } catch(e) {\n        console.error(e);             \/\/ \uc5d0\ub7ec\ub0b4\uc6a9 \ud655\uc778\n    } finally {\n\t\t\t\treturn followerCount + 1;     \/\/ \ubb34\uc870\uac74 \ud55c\ubc88 \uc2e4\ud589\n\t\t}\n};\n\nfollower();\n\n\/\/ TypeError: Assignment to constant variable.\n\/\/ 101\n<\/code><\/pre>\n<p>\uc6b0\uc120 try \ucf54\ub4dc\ube14\ub85d \ub0b4\ubd80\ub97c \uc0b4\ud3b4\ubcf4\uba74, \uc804\uc5ed\uc5d0\uc11c const\ub85c followerCount \uac12\uc774 \uc120\uc5b8\ub418\uc5c8\uc74c\uc5d0\ub3c4 \ubcc0\uacbd\uc744 \uc2dc\ub3c4\ud558\uace0 \uc788\ub2e4. \uc774\ub85c \uc778\ud574 \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud558\uba74 <code>console.log(&#39;skip&#39;)<\/code>\uc774 \uc2e4\ud589\ub418\uc9c0 \uc54a\ub294\ub2e4. \uc5d0\ub7ec \ubc1c\uc0dd \uc2dc \ubc14\ub85c catch \ubb38\uc73c\ub85c \uc774\ub3d9\ud558\uae30 \ub54c\ubb38\uc774\ub2e4. \uadf8 \ub2e4\uc74c catch \ucf54\ub4dc \ube14\ub85d\uc5d0\uc11c  \uc5d0\ub7ec \uac1d\uccb4\ub97c \ub2f4\uae30 \uc704\ud55c \ubcc0\uc218\uc778 e\uc758 \ub0b4\uc6a9\uc744 \ud655\uc778\ud560 \uc218 \uc788\uace0, \uc5d0\ub7ec \ubc1c\uc0dd \uc5ec\ubd80\uc640 \uc0c1\uad00\uc5c6\uc774 finally \ucf54\ub4dc \ube14\ub85d\uc774 \uc2e4\ud589\ub41c\ub2e4.<\/p>\n<h2>6. \uc694\uccad\uac1d\uccb4\ub97c \uc0dd\uc131\ud558\uace0 \uc804\uc1a1\ud558\uae30<\/h2>\n<h3>6.1. <strong>Request() <\/strong>\uc0dd\uc131\uc790\ub85c \uc0dd\uc131\ud55c \uc694\uccad \uac1d\uccb4\ub97c \uc778\uc790\ub85c \uc804\ub2ec<\/h3>\n<p>\uc6b0\ub9ac\uac00 fetch() \ud638\ucd9c\ud560\ub54c \ub9ac\uc18c\uc2a4 \uacbd\ub85c\ub97c \uc81c\uacf5\ud558\ub294 \ub300\uc2e0\uc5d0 <strong>Request() \uc0dd\uc131\uc790\ub85c \uc0dd\uc131\ud55c \uc694\uccad \uac1d\uccb4\ub97c \ud1b5\ud574 \uc778\uc790\ub85c \uc804\ub2ec\ud558\uc5ec \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4. \uadf8\ub807\ub2e4\uba74 Request() \uc0dd\uc131\uc790\ub780 \ubb34\uc5c7\uc77c\uae4c?<\/strong><\/p>\n<h4>6.1.1 <strong>Request() \uc0dd\uc131\uc790<\/strong><\/h4>\n<p><strong><code>Request()<\/code><\/strong><strong> <\/strong>\uc0dd\uc131\uc790\ub294 \uc0c8\ub85c\uc6b4 <strong>Request <\/strong>\uac1d\uccb4\ub97c \uc0dd\uc131\ud560 \uc218 \uc788\ub2e4.  <code>fetch()<\/code> \uba54\uc11c\ub4dc\uc758 \ub9e4\uac1c\ubcc0\uc218\uc640 \ub3d9\uc77c\ud558\uac8c \uccab\ubc88 \uc9f8 \uc778\uc790 \uac12 input\uc5d0\ub294 \uc811\uadfc\ud558\uace0\uc790 \ud558\ub294 URL \uc744 \ub2f4\uace0, \ub450 \ubc88\uc9f8 \uc778\uc790 \uac12 init\uc5d0\ub294 method\ub098 header, body \ub4f1\uc758 \uc635\uc158\uc744 \uc9c0\uc815\ud560 \uc218 \uc788\ub2e4.  <\/p>\n<pre><code class=\"language-javascript\">const myRequest = new Request(input, init);\n<\/code><\/pre>\n<p>\uc608\uc2dc<\/p>\n<pre><code class=\"language-javascript\">const myRequest = new Request(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n\theaders: {\n\t\t&quot;Content-Type&quot;: &quot;application\/json&quot;,\n\t},\n});\n\nfetch(myRequest)\n\t.then(res =&gt; res.json())\n\t.then(data =&gt; console.log(data));\n<\/code><\/pre>\n<h4>6.1.2 \uc65c \uc368\uc57c\ud560\uae4c?<\/h4>\n<p>\uae30\uc874\uc5d0 \uc874\uc7ac\ud558\ub294 \uc694\uccad \uac1d\uccb4\ub97c \uc804\ub2ec\ud574\uc11c \ubcf5\uc0ac\ubcf8\uc744 \uc0dd\uc131\ud558\ub294 \uac83\uc774 \uac00\ub2a5\ud558\ub2e4. \uc774\ub807\uac8c \ubcf5\uc0ac\ubcf8 \uc0dd\uc131\uc744 \ud574\ub450\uba74 \ub2e4\uc2dc \uae30\uc874\uc5d0 \uc0dd\uc131\ud574\ub454 \uc694\uccad\uacfc \uc751\ub2f5 \uac1d\uccb4\ub97c \ub2e4\uc2dc \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.  \ub610\ud55c \ub2e4\uc2dc \uc0ac\uc6a9\ud558\ub418, init \uc635\uc158\ub9cc \ub530\ub85c \uad50\uccb4\ud560 \uc218\ub3c4 \uc788\ub2e4. \ud558\uc9c0\ub9cc \uc774\ubbf8 \ubcf8\ubb38\uc744 \uc77d\uc740 \uc694\uccad \ub610\ub294 \uc751\ub2f5\uc744 \ubcf5\uc0ac\ud560 \uc218 \uc5c6\ub2e4. \uc989 \ubcf5\uc0ac\ubcf8\uc740 \uc6d0\ubcf8 \ubcf8\ubb38\uc744 \uc77d\uae30\uc804\uc5d0 \uc0dd\uc131\ud574\uc57c \ud55c\ub2e4.   <\/p>\n<pre><code class=\"language-javascript\">const copyRequest = new Request(myRequest);\n<\/code><\/pre>\n<blockquote>\n<p><strong>Info<\/strong>: \ud83d\udca1 \ucc38\uace0\ub85c, \uc624\uc9c1 \ubcf5\uc0ac\ubcf8 \uc0dd\uc131\uc744 \uc704\ud55c clone() \uba54\uc11c\ub4dc\ub3c4 \uc874\uc7ac\ud55c\ub2e4. \ud604\uc7ac Request \uac1d\uccb4\uc758 \ubcf5\uc0ac\ubcf8\uc744 \ub9cc\ub4dc\ub294 clone \uba54\uc11c\ub4dc \ub610\ud55c \ub9c8\ucc2c\uac00\uc9c0\ub85c \uc694\uccad \ubcf8\ubb38\uc774 \uc774\ubbf8 \uc0ac\uc6a9\ub41c \uacbd\uc6b0 TypeError\ub97c \ubc1c\uc0dd\uc2dc\ud0a8\ub2e4. \uc55e\uc11c \ubc30\uc6b4 Request \uc0dd\uc131\uc790\uc640 \ub3d9\uc77c\ud558\uac8c \ubcf5\uc0ac\ubcf8\uc744 \uc0dd\uc131\ud560 \uc218 \uc788\uc9c0\ub9cc clone\uba54\uc11c\ub4dc\uc758 \uc8fc\ub41c \ubaa9\uc801\uc740 body\uc758 object\uc758 \ub2e4\uc911 \uc0ac\uc6a9\uc744 \uc704\ud568\uc774\uace0, \uc694\uccad\uc744 \uc218\uc815\ud558\ub824\ub294 \uacbd\uc6b0\uc5d0\ub294 Request \uc0dd\uc131\uc790\ub97c \ub354 \uc120\ud638\ud55c\ub2e4.<\/p>\n<\/blockquote>\n<h2>7. Axios \uc2dc\uc791\ud558\uae30<\/h2>\n<h3>7.1 Axios \uc0ac\uc6a9 \uc774\uc720<\/h3>\n<h4>7.1.1 Axios \uc815\uc758<\/h4>\n<p>Axios\ub294 node.js\uc640 \ube0c\ub77c\uc6b0\uc800\ub97c \uc704\ud55c Promise\uae30\ubc18 HTTP\ud074\ub77c\uc774\uc5b8\ud2b8 \uc774\ub2e4. \ub3d9\uc77c\ud55c \ucf54\ub4dc\ubca0\uc774\uc2a4\ub85c \ube0c\ub77c\uc6b0\uc800\uc640 node.js\uc5d0\uc11c \uc2e4\ud589\ud560 \uc218 \uc788\uc73c\uba70, \uc11c\ubc84 \uc0ac\uc774\ub4dc\uc5d0\uc11c\ub294 \ub124\uc774\ud2f0\ube0c node.js\uc758 http\ubaa8\ub4c8\uc744 \uc0ac\uc6a9\ud558\uace0, \ud074\ub77c\uc774\uc5b8\ud2b8(\ube0c\ub77c\uc6b0\uc800)\uc5d0\uc11c\ub294 XMLHttpRequests\ub97c \uc0ac\uc6a9\ud55c\ub2e4.[1]<\/p>\n<h4>7.1.2 Axios \uc0ac\uc6a9 \uc774\uc720<\/h4>\n<p>Axios\ub294 return\uc744 promise\ub85c \ud574\uc8fc\uae30 \ub54c\ubb38\uc5d0 response\ub370\uc774\ud130\ub97c \ucc98\ub9ac\ud558\ub294\ub370 \uc218\uc6d4\ud558\uace0, Fetch API\uc640\ub294 \ub2ec\ub9ac \ud06c\ub85c\uc2a4 \ube0c\ub77c\uc6b0\uc9d5\uc5d0 \ucd5c\uc801\ud654\ub418\uc5b4 \uc788\uc5b4 \uc624\ub798\ub41c \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c\ub3c4 \uc9c0\uc6d0\ud55c\ub2e4. \ub610\ud55c Fetch\uc5d0 \ube44\ud574Axios\ub85c \uc5d0\ub7ec\ub97c \ucc98\ub9ac\ud558\ub294\uac8c \ub354\uc6b1 \uac04\uacb0\ud558\uba70, <code>.json()<\/code> \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uc544\ub3c4 \uc790\ub3d9\uc73c\ub85c JSON \ub370\uc774\ud130 \ud615\uc2dd\uc73c\ub85c \ubcc0\ud658\ub41c\ub2e4. \uc694\uccad\uc744 \ucde8\uc18c\ud560 \uc218 \uc788\uace0 \ud0c0\uc784\uc544\uc6c3\uc744 \uac78 \uc218 \uc788\uc73c\uba70, CSRF[<em>2<\/em>] \ubcf4\ud638 \uae30\ub2a5\uc774 \ub0b4\uc7a5\ub418\uc5b4 \uc788\uc5b4 \ubcf4\uc548\uc5d0 \ub354\uc6b1 \uc6a9\uc774\ud558\ub2e4.<\/p>\n<h3>7.2 Axios\uc640 Fetch\uc758 \ucc28\uc774<\/h3>\n<h4>7.2.1 Axios\uc640 Fetch\uc5d0 \ub300\ud574\uc11c<\/h4>\n<p><code>Axios<\/code> \ub294 \ube0c\ub77c\uc6b0\uc800\uc640 node.js\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 Promise \uae30\ubc18 HTTP \ud074\ub77c\uc774\uc5b8\ud2b8 \ub77c\uc774\ube0c\ub7ec\ub9ac\uc774\uba70, npm\uc774\ub098 yarn\uacfc \uac19\uc740 \ud328\ud0a4\uc9c0 \ub9e4\ub2c8\uc800\ub97c \ud1b5\ud574 \uc124\uce58\ud560 \uc218 \uc788\ub2e4.<br \/>\n<code>Fetch<\/code> \ub294 API\uac00 \uc81c\uacf5\ud558\ub294 \uc804\uc5ed fetch()\uba54\uc11c\ub4dc\ub97c \ud1b5\ud574 \ub124\ud2b8\uc6cc\ud06c\uc758 \ub9ac\uc18c\uc2a4\ub97c \ube44\ub3d9\uae30\uc801\uc73c\ub85c \uac00\uc838\uc62c \uc218 \uc788\ub2e4.  \uadf8\ub9ac\uace0, \ubaa8\ub358 \ube0c\ub77c\uc6b0\uc800\uc5d0 \ub0b4\uc7a5\ub418\uc5b4 \uc788\uc5b4 Axios\ucc98\ub7fc \ub530\ub85c \uc124\uce58\ud560 \ud544\uc694\uac00 \uc5c6\ub2e4.<br \/>\n<code>Axios<\/code>\uc640 <code>Fetch<\/code> \ubaa8\ub450 Promise \uae30\ubc18\uc758 HTTP \ud074\ub77c\uc774\uc5b8\ud2b8\uc774\uae30 \ub54c\ubb38\uc5d0 \ub124\ud2b8\uc6cc\ud06c \uc694\uccad\uc2dc Promise\uac00 \ubc18\ud658\ub418\uc5b4 \ub370\uc774\ud130 \ub2e4\ub8e8\uae30 \ud3b8\ub9ac\ud558\ub2e4. <\/p>\n<h4>7.2.2 Axios\uc640 Fetch\uc758 \uae30\ub2a5 \ucc28\uc774<\/h4>\n<h4>JSON \ub370\uc774\ud130 \ubcc0\ud658<\/h4>\n<p>Axios\uc640 Fetch\ub97c \uc774\uc6a9\ud574 \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc62c \ub54c \ub370\uc774\ud130 \ud615\uc2dd\uc758 \ucc28\uc774\uc5d0 \ub300\ud574\uc11c \uc54c\uc544\ubcf4\uc790. <\/p>\n<p>JSONPlaceHolder\ub77c\ub294 REST API\uc5d0   <code>GET<\/code> \uc694\uccad\uc73c\ub85c \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc624\uace0 \uc9c1\uc811 \ube44\uad50\ud574\ubcf4\uc790. \uc544\ub798\ub294  <code>Fetch<\/code> \uc758 <code>GET<\/code> \uc694\uccad\uc744 \ud1b5\ud574 \ud22c\ub450 \ub9ac\uc2a4\ud2b8\uc758 \uccab\ubc88\uc9f8 \uc544\uc774\ud15c \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\ub294 \uc608\uc81c\uc774\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">const url = &quot;https:\/\/jsonplaceholder.typicode.com\/todos\/1&quot;;\n\nfetch(url)\n  .then((response) =&gt; response.**json()**)\n  .then(console.log);\n<\/code><\/pre>\n<p>\uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/19-2.png\" alt=\"\"><\/p>\n<p><code>fetch()<\/code>\ub294 <strong>JSON \ub370\uc774\ud130\uc758 \ud3ec\ub9f7\uc774 \uc544\ub2cc \ud615\ud0dc<\/strong>\ub85c \uc751\ub2f5 \ub370\uc774\ud130\ub97c \ubc18\ud658\ud55c\ub2e4. \uadf8\ub798\uc11c, \uc751\ub2f5\uac1d\uccb4\uc758 <code>.json()<\/code>\uba54\uc11c\ub4dc\ub97c \ud638\ucd9c\ud558\uc5ec JSON\ud615\uc2dd\uc758 \ub370\uc774\ud130\ub85c \ub41c \ub610 \ub2e4\ub978 \ub370\uc774\ud130\ub97c \ubc18\ud658\ud574\uc57c \ud55c\ub2e4. <\/p>\n<p>\uc544\ub798 \ucf54\ub4dc\ub294 \uac19\uc740 \uc694\uccad\uc744 <code>Axios<\/code>\ub85c \uc218\ud589\ud558\ub294 \ucf54\ub4dc\uc774\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">const url = &quot;https:\/\/jsonplaceholder.typicode.com\/todos\/1&quot;;\n\naxios(url)\n\t.then((response) =&gt; console.log(response.**data**));\n<\/code><\/pre>\n<p><code>Axios<\/code>\ub294 <strong>\uae30\ubcf8\uc801\uc73c\ub85c JSON \ud0c0\uc785<\/strong>\uc73c\ub85c \ub41c \uc751\ub2f5 \ub370\uc774\ud130\ub97c \ubc18\ud658\ud55c\ub2e4. \uc751\ub2f5 \uac1d\uccb4\uc758 <strong>data \ud504\ub85c\ud37c\ud2f0<\/strong>\ub97c \ud1b5\ud574\uc11c \uc751\ub2f5 \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/p>\n<h4>\uc790\ub3d9 \ubb38\uc790\uc5f4 \ubc18\ud658<\/h4>\n<p>\uc774\ubc88\uc5d0\ub294 <code>Axios<\/code> \uc640 <code>Fetch<\/code> \uc758 \ub370\uc774\ud130\ub97c \ubb38\uc790\uc5f4\ub85c \ubcc0\ud658\ud574\uc8fc\ub294 \ubc29\ubc95\uc758 \ucc28\uc774\uc5d0 \ub300\ud574\uc11c \uc54c\uc544\ubcf4\uc790. <\/p>\n<p>\uc544\ub798\ub294  <code>Fetch<\/code>\uc758 <code>PUT<\/code>\uacfc <code>Axios<\/code>\uc758 <code>PUT<\/code>\uc744 \ube44\uad50\ud558\ub294 \uc608\uc81c\uc774\ub2e4.  <code>Fetch<\/code> \uc758 <code>PUT<\/code> \uc694\uccad\uc744 \ud1b5\ud574\uc11c \ub370\uc774\ud130\ub97c \ubcc0\ud658\ud558\uc790.  Fetch \ucc55\ud130\uc758 PUT\uc5d0\uc11c \uc0ac\uc6a9\ud55c \uc608\uc81c\ub97c \uae30\ubc18\uc73c\ub85c \ube44\uad50\ud574\ubcf4\uc790. (9.3 Axios PUT \uc694\uccad\uc744 \ucc38\uc870.)<\/p>\n<pre><code class=\"language-javascript\">async function putData(url = &#39;&#39;, data = {}, token = &#39;&#39;) {\n  try {\n    const response = await fetch(url, { \/\/1\ufe0f\u20e3\n      method: &#39;PUT&#39;,\n      headers: {\n        &#39;Content-Type&#39;: &#39;application\/json&#39;,\n         Authorization: token,\n      },\n      **body**: **JSON.stringify(data)**, \/\/2\ufe0f\u20e3\n    });\n    return response.json();\n  } catch (error) {\n    console.log(error);\n\t}\n}\n\nputData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n  id: 1,\n  title: &quot;Put test&quot;,\n  body: &quot;fetch\uc758 Put \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n  userId: 1,\n}).then((data) =&gt; {\n  console.log(data);\n});\n<\/code><\/pre>\n<p>\uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/20-2.png\" alt=\"\"><\/p>\n<p><code>Fetch<\/code> \uc5d0\uc11c\ub294  <code>JSON.stringify()<\/code> \ub97c \uc0ac\uc6a9\ud574\uc11c \uac1d\uccb4\ub97c \ubb38\uc790\uc5f4\ub85c \ubcc0\uacbd\ud574\uc8fc\uace0, <code>body<\/code> \uc5d0 \ud560\ub2f9\ud574\uc57c \ud55c\ub2e4. <\/p>\n<p>\uc544\ub798 \ucf54\ub4dc\ub294 \uac19\uc740 \uc694\uccad\uc744 <code>Axios<\/code>\ub85c \uc218\ud589\ud558\ub294 \ucf54\ub4dc\uc774\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">async function putData(url = &#39;&#39;, data = {}, token = &#39;&#39;) {\n  try {\n    const response = await axios(url, { \/\/1\ufe0f\u20e3\n      method: &#39;PUT&#39;,\n      headers: {\n        &#39;Content-Type&#39;: &#39;application\/json&#39;,\n         Authorization: token,\n      },\n      **data: data**, \/\/2\ufe0f\u20e3\n    })\n\t\t.then((response) =&gt; console.log(response.data));\n  } catch (error) {\n    console.log(error);\n\t}\n}\n\nputData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n  id: 1,\n  title: &quot;Put test&quot;,\n  body: &quot;axios\uc758 Put \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n  userId: 1,\n}).then((data) =&gt; {\n  console.log(data);\n});\n<\/code><\/pre>\n<p>\uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/21-2.png\" alt=\"\"><\/p>\n<p><code>Axios<\/code> \uc5d0\uc11c\ub294 \uc790\ub3d9\uc73c\ub85c \ub370\uc774\ud130\ub97c \ubb38\uc790\uc5f4\ub85c \ubcc0\ud658\ub418\uc5b4 \ub370\uc774\ud130 \ud615\uc2dd\uc744 \ubcc0\ud658\ud558\ub294 \ud568\uc218\ub97c \uc0ac\uc6a9\ud560 \ud544\uc694\uac00 \uc5c6\uc73c\uba70, \ubcc0\uacbd\ud558\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130\ub294 data \ud504\ub85c\ud37c\ud2f0\uc5d0 \ud560\ub2f9\ud55c\ub2e4. <\/p>\n<p>\ub458\uc758 \ucc28\uc774\ub97c \uc8fc\uc11d\uc5d0 \uc801\ud600\uc9c4 1\ufe0f\u20e3, 2\ufe0f\u20e3\ub97c \ube44\uad50\ud558\uba70 \uc54c\uc544\ubcf4\uc790. 1\ufe0f\u20e3\uc740 <code>fetch<\/code> \u2192 <code>axios<\/code> \ub85c \ubc14\ub00c\uc5c8\uace0, 2\ufe0f\u20e3\ub294 \ubcc0\uacbd\ud558\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130\ub294 <code>body<\/code> \u2192 <code>data<\/code>\ub85c \ud560\ub2f9\ub418\uc5c8\uc73c\uba70 \ub370\uc774\ud130 \ud615\uc2dd\uc744 \ubcc0\ud658\ud558\ub294 \ud568\uc218\uc778 <code>JSON.stringify()<\/code> \ub294 \ub530\ub85c \uc801\uc5b4\uc8fc\uc9c0 \uc54a\ub294\ub2e4.<\/p>\n<h4>7.2.3 Request \ucde8\uc18c \ubc0f Timeout \uc124\uc815<\/h4>\n<p>HTTP \uc694\uccad \uc2dc\uac04\uc774 \ucd08\uacfc \ub420 \uacbd\uc6b0 \uc694\uccad\uc744 \ucde8\uc18c\ud558\uae30 \uc704\ud574\uc11c \uc5b4\ub5bb\uac8c \ucc98\ub9ac\ud574\uc57c\ud558\ub294\uc9c0 \uc0b4\ud3b4\ubcf4\uc790.<\/p>\n<pre><code class=\"language-javascript\">const url = &quot;https:\/\/jsonplaceholder.typicode.com\/todos\/2&quot;;\n\naxios\n  .get(url, {\n    timeout: 10, \/\/ \uc694\uccad\uc774 0.01\ucd08\uc774\uc0c1 \uac78\ub9ac\uba74 \uc885\ub8cc\ud558\uace0 error \ub744\uc6b0\uae30\n  })\n  .then((response) =&gt; console.log(response.data))\n  .catch((error) =&gt; {\n    console.log(error.message);\n  });\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/22-2.png\" alt=\"Axios: \uc2dc\uac04\ub0b4\uc5d0 \uc694\uccad\uc744 \uc885\ub8cc\ud558\uc9c0 \ubabb\ud588\uc744 \ub54c, \uc694\uccad\uc744 \ucde8\uc18c\ud568\"><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/23-2.png\" alt=\"Axios: \uc2dc\uac04 \ub0b4\uc5d0 \uc694\uccad\uc744 \uc218\ud589\ud588\uc744 \ub54c, \uc815\uc0c1\uc801\uc73c\ub85c \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc634\"><\/p>\n<p><code>Axios<\/code>\uc5d0\uc11c\ub294 timeout \uc18d\uc131\uc73c\ub85c \uac04\ub2e8\ud558\uac8c \uc694\uccad \uc885\ub8cc\uc2dc\uac04\uc744 \uc9c0\uc815\ud560 \uc218 \uc788\ub2e4.<\/p>\n<p>\uc544\ub798 \ucf54\ub4dc\ub294 \uac19\uc740 \uc694\uccad\uc744 <code>Fetch<\/code>\ub85c \uc218\ud589\ud558\ub294 \ucf54\ub4dc\uc774\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">const url = &quot;https:\/\/jsonplaceholder.typicode.com\/todos\/2&quot;;\n\nconst abortcontroller = new AbortController();\nconst signal = abortcontroller.signal;\nsetTimeout(() =&gt; abortcontroller.abort(), 10);\n\nfetch(url, {\n\tsignal: signal,\n})\n  .then((response) =&gt; response.json())\n  .then(console.log)\n  .catch((err) =&gt; {\n\t  console.error(err.message);\n  });\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/24-2.png\" alt=\"Fetch: \uc2dc\uac04 \ub0b4\uc5d0 \uc694\uccad\uc744 \uc885\ub8cc\ud558\uc9c0 \ubabb\ud588\uc744 \ub54c, \uc694\uccad\uc744 \ucde8\uc18c\ud568\"><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/25-1.png\" alt=\"Fetch: \uc2dc\uac04 \ub0b4\uc5d0 \uc694\uccad\uc744 \uc218\ud589\ud588\uc744 \ub54c, \uc815\uc0c1\uc801\uc73c\ub85c \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc634\"><\/p>\n<p><code>Fetch<\/code>\uc5d0\uc11c\ub294  AbortController \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc694\uccad \uc885\ub8cc\uc2dc\uac04\uc744 \uc9c0\uc815\ud560 \uc218 \uc788\ub2e4.<br \/>\nabortcontroller \uac1d\uccb4 \uc0dd\uc131 \ub4a4, signal \uac1d\uccb4\uc640 abort()\uba54\uc11c\ub4dc\uc5d0 \uc811\uadfc\ud588\ub2e4. signal \uac1d\uccb4\ub97c \uc124\uc815 \uc635\uc158\uc5d0 \ucd94\uac00\ud558\uc5ec \uc11c\ubc84\uac00 \uc9c0\uc815\ud55c \uc2dc\uac04 \uc774\ub0b4\uc5d0 \uc751\ub2f5\ud558\uc9c0 \uc54a\uc73c\uba74 fetch \uc694\uccad\uc774 \uc885\ub8cc\ub41c\ub2e4. <\/p>\n<h4>7.2.4 \ube0c\ub77c\uc6b0\uc800 \uc9c0\uc6d0<\/h4>\n<p>Axios\ub294 \ud06c\ub85c\uc2a4 \ube0c\ub77c\uc6b0\uc9d5 \ucd5c\uc801\ud654\ub85c \ud3ed\ub113\uc740 \ube0c\ub77c\uc6b0\uc800 \ud638\ud658\uc131\uc744 \ubcf4\uc7a5\ud55c\ub2e4.<br \/>\nFetch\ub294 \ud06c\ub86c 42, edge 14, Firefox 39, Opera 29, Safari 10.1\uc5d0\uc11c \uc9c0\uc6d0\ud55c\ub2e4. \ud558\uc9c0\ub9cc, Internet Explorer\uc5d0\uc11c\ub294 \uc9c0\uc6d0\ud558\uc9c0 \uc54a\ub294\ub370, \uc774\ub294 polyfill\uc744 \uc774\uc6a9\ud574\uc11c \uc0ac\uc6a9\uc774 \uac00\ub2a5\ud558\ub2e4. <\/p>\n<h4>7.2.5 Axios\uc640 Fetch \uc911 \uc5b4\ub5a4 \uac83\uc744 \uc368\uc57c \ud560\uae4c<\/h4>\n<p>\uac1c\uc778\uc758 \uc0ac\uc6a9 \ud3b8\uc758\uc131\uc5d0 \ub530\ub77c\uc11c \ub2ec\ub77c\uc9c8 \uc218 \uc788\ub2e4. Axios\ub294 \ub530\ub85c \uc124\uce58\ub97c \ud574\uc57c\ud558\uc9c0\ub9cc,  \uc704\uc640 \uac19\uc774 \uc5ec\ub7ec \uae30\ub2a5\uc744 \uac04\ub2e8\ud558\uac8c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uc7a5\uc810\uc774 \uc788\ub2e4. Fetch\ub294 \ubcc4\ub3c4\uc758 \uc124\uce58 \uc5c6\uc774 \ubc14\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc9c0\ub9cc, Axios\uc5d0\uc11c \uc27d\uac8c \uad6c\ud604\uc774 \uac00\ub2a5\ud55c \uae30\ub2a5\uc774 fetch\uc5d0\uc11c\ub294 \uc9c1\uc811 \uad6c\ud604\ud574\uc57c \ud558\ub294 \ubc88\uac70\ub85c\uc6c0\uc774 \uc788\ub2e4. \uc774\ub7ec\ud55c \ud2b9\uc131\uc744 \uace0\ub824\ud558\uc5ec \ubcf8\uc778\uc5d0\uac8c \ud3b8\ub9ac\ud55c \uac83\uc744 \uc120\ud0dd\ud558\uc5ec \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc88b\ub2e4.  <\/p>\n<h3>7.3 Axios \uc2dc\uc791\ud558\uae30<\/h3>\n<p>Axios\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud558\uc5ec \uba3c\uc800 Axios\ub97c \uc124\uce58\ud574\uc8fc\uc5b4\uc57c \ud55c\ub2e4. Axios\ub97c \uc124\uce58\ud558\ub294 \ubc29\ubc95\uc740 \uc544\ub798\uc640 \uac19\uc774 \ud06c\uac8c 2\uac00\uc9c0\uac00 \uc788\ub2e4. <\/p>\n<h4>7.3.1 Node.js \uac1c\ubc1c \ud658\uacbd\uc5d0\uc11c \uc124\uce58\/\uc0ac\uc6a9<\/h4>\n<p>Node.js \uac1c\ubc1c \ud658\uacbd\uc5d0\uc11c \uc124\uce58\ub97c \ud558\uae30 \uc704\ud574\uc11c \uba3c\uc800 Node.js\ub97c \uc124\uce58\ud574\uc8fc\uc5b4\uc57c \ud55c\ub2e4. (\uc124\uce58 \ub9c1\ud06c: <a href=\"https:\/\/nodejs.org\/ko\/\">https:\/\/nodejs.org\/ko\/<\/a>) Node.js \uc124\uce58 \uc644\ub8cc \ud6c4, \uc5d0\ub514\ud130\uc758 \ud130\ubbf8\ub110 \ucc3d\uc5d0 \uc544\ub798\uc640 \uac19\uc740 \uba85\ub839\uc5b4\ub97c \uc785\ub825\ud558\uc5ec Axios\ub97c \uc124\uce58\ud574 \uc900\ub2e4.<\/p>\n<pre><code class=\"language-powershell\">npm install axios \n<\/code><\/pre>\n<pre><code class=\"language-powershell\">yarn add axios\n<\/code><\/pre>\n<p>\uc704 \ub450 \uac00\uc9c0 \uba85\ub839\uc5b4 \uc911 \ud55c\uac00\uc9c0\ub97c \uc120\ud0dd\ud558\uc5ec \uc0ac\uc6a9\ud558\uba74 \ub41c\ub2e4. \ub2e8 npm\uacfc yarn\uc758 \ud328\ud0a4\uc9c0 \uad00\ub9ac\ubc29\uc2dd\uc740 \ucc28\uc774\uac00 \uc788\uae30 \ub54c\ubb38\uc5d0 \ud63c\uc6a9\ud558\uba74 \ucda9\ub3cc\uc774 \uc77c\uc5b4\ub0a0 \uc218 \uc788\ub2e4. \ub530\ub77c\uc11c \uac00\uae09\uc801 \ud63c\uc6a9\ud558\uc9c0 \uc54a\ub3c4\ub85d \ud55c\ub2e4.<\/p>\n<h4>7.3.2 \ube0c\ub77c\uc6b0\uc800 \ud658\uacbd\uc5d0\uc11c \uc124\uce58\/\uc0ac\uc6a9<\/h4>\n<p>\ube0c\ub77c\uc6b0\uc800 \ud658\uacbd\uc5d0\uc11c Axios\ub97c \uc124\uce58 \ubc0f \uc0ac\uc6a9\ud558\uae30 \uc704\ud558\uc5ec CDN\uc744 \uc0ac\uc6a9\ud55c\ub2e4. \uc544\ub798\uc640 \uac19\uc740 Axios CDN\ub9c1\ud06c\uac00 \ub4e4\uc5b4\uac04 \uc2a4\ud06c\ub9bd\ud2b8\ub97c \ucd94\uac00\ud574 \uc900\ub2e4.<\/p>\n<pre><code class=\"language-html\">&lt;script src=&quot;https:\/\/unpkg.com\/axios\/dist\/axios.min.js&quot;&gt;&lt;\/script&gt;\n<\/code><\/pre>\n<h2>8. Axios \ubb38\ubc95<\/h2>\n<h3>8.1 Axios API<\/h3>\n<p>Axios API \uc758 \uc0ac\uc6a9 \ubc29\ubc95\uc740 \uae30\ubcf8\uc801\uc73c\ub85c \uc544\ub798\uc640 \uac19\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">**axios(config)\naxios(url, [config])\naxios.**\uc694\uccad\uba54\uc11c\ub4dc**(url, [, data[,config]])**\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">axios({\n\tmethod: &quot;get&quot;,\n\turl: &quot;https:\/\/jsonplaceholder.typicode.com\/post\/1&quot;,\n  ... (\ucd94\uac00\ud558\uace0 \uc2f6\uc740 \uc635\uc158\ub4e4)\n})\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">axios(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,{\n\tmethod: &quot;get&quot;,\n})\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">axios.get(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,{\n\tdata(POST, PUT, PATCH \ub9cc) , {config}\n}\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/26-scaled.png\" alt=\"\"><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/27-scaled.png\" alt=\"\"><\/p>\n<h4>8.1.1 \uc694\uccad config \uc635\uc158\ub4e4<\/h4>\n<p>\uc0ac\uc6a9 \uac00\ub2a5\ud55c config \uc758 \uc124\uc815\uc635\uc158\ub4e4 \uc911 \uc790\uc8fc\uc4f0\uc774\ub294 \uac83\ub4e4\uc744 \uace8\ub77c\ubcf4\uc558\ub2e4. \ub098\uba38\uc9c0 \uc635\uc158\ub4e4\uacfc default\uac12 \uc740 axios \uae43\ud5d9 [8.8.<a href=\"https:\/\/github.com\/axios\/axios\/blob\/v1.x\/lib\/defaults\/index.js\">1<\/a>]\uc5d0\uc11c \ubcfc \uc218 \uc788\ub2e4.<br \/>\n<strong>URL <\/strong><br \/>\n\uc694\uccad\uc5d0 \uc0ac\uc6a9\ub420 \uc11c\ubc84 URL \uc774\uace0 config \uc5d0\uc11c \ud544\uc218\ub85c \ub4e4\uc5b4\uac00\uc57c\ud55c\ub2e4. \uc544\ub798\uc640 \uac19\uc774 \uc0ac\uc6a9\ud55c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios({\n\turl: &quot;https:\/\/jsonplaceholder.typicode.com\/post\/1&quot;\n})\n<\/code><\/pre>\n<p><strong>baseURL<\/strong><br \/>\nURL\uc758 \uae30\ubcf8\uac12\uc744 \uc124\uc815\ud560 \uc218 \uc788\ub2e4. URL\uc774 \uc808\ub300\uac12\uc774 \uc544\ub2cc\uacbd\uc6b0 URL \uc55e\uc5d0 \ubd99\ub294\ub2e4. \uc544\ub798 \uc0ac\uc6a9\uc608\uc81c \ucc98\ub7fc baseURL \uc744 \uc124\uc815\ub418\uc5b4\uc788\uc744 \ub54c URL \uc774 \uc808\ub300\uac12\uc774 \uc544\ub2cc\uacbd\uc6b0 URL \uc55e\uc5d0 \ubd99\uc5b4\uc11c \ucc98\ub9ac\ub41c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios({\nmethod: &quot;get&quot;,\nurl: &quot;\/posts\/1&quot;,\nbaseURL : &quot;https:\/\/jsonplaceholder.typicode.com&quot;\n})\n\/\/ \uc774\ub807\uac8c baseURL \uc744 \uc8fc\uace0 url \ub85c \ub2e4\ub978 \uacbd\ub85c\ub97c \uc8fc\uba74 url\ub85c \ub300\uccb4\ub41c\ub2e4.\naxios({\nmethod: &quot;get&quot;,\nurl: &quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,\nbaseURL : &quot;https:\/\/jsonplaceholder.typicode.com&quot;\n})\n<\/code><\/pre>\n<p><strong>headers<\/strong><br \/>\n\uc0ac\uc6a9\uc790 \uc9c0\uc815 \ud5e4\ub354 , \uc544\ub798\uc640 \uac19\uc774 \uc0ac\uc6a9\ud574\uc11c \uc124\uc815 \ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">headers: {&#39;Content-Type&#39;: &#39;application\/json&#39;}\n<\/code><\/pre>\n<blockquote>\n<p><strong>Info<\/strong>: \ud83d\udca1 <strong>\uc804\uc1a1\ud558\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130\uac00 JSON \ud615\uc2dd\uc77c \uacbd\uc6b0<br \/>\n<strong><code>Axios<\/code>\ub294 \uae30\ubcf8\uc801\uc73c\ub85c <code>JSON<\/code> \ud615\ud0dc\uc758 \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud558\uae30 \ub54c\ubb38\uc5d0, <code>Axios<\/code>\uc5d0 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \uac1d\uccb4\ub97c \uc804\ub2ec\ud574\uc8fc\uba74 <code>Axios<\/code>\ub294 \uc790\ub3d9\uc801\uc73c\ub85c \ud574\ub2f9 \uac1d\uccb4\ub97c \uc9c1\ub82c\ud654(serialize)\ud558\uace0, <code>content-type<\/code> \ud5e4\ub354\ub97c \ubcc4\ub3c4\ub85c \uc9c0\uc815\ud574\uc8fc\uc9c0 \uc54a\uc544\ub3c4 \uc790\ub3d9\uc801\uc73c\ub85c <code>application\/json<\/code> \uc73c\ub85c \uc124\uc815\ud574\uc900\ub2e4. \ud558\uc9c0\ub9cc \uc5d0\ub7ec\uc5d0 \ub300\ube44\ud558\uc5ec \ud5e4\ub354\ub97c \uc9c0\uc815\ud574\uc8fc\ub294 \uac83\uc774 \uad8c\uc7a5\ub418\ubbc0\ub85c, \uc774\ub294<\/strong> [9.2.3] \ucc55\ud130\uc758<\/strong> <strong>\uc608\uc81c3<\/strong>\uc5d0\uc11c \ub354\uc6b1 \uc790\uc138\ud788 \uc0b4\ud3b4\ubcf4\ub3c4\ub85d \ud558\uaca0\ub2e4.<\/p>\n<\/blockquote>\n<p><strong>params<\/strong><br \/>\n\uc694\uccad\uacfc \ud568\uaed8 \uc804\uc1a1\ub418\ub294 url \ud30c\ub77c\ubbf8\ud130\uc774\ub2e4. \ubc18\ub4dc\uc2dc <strong>\uc77c\ubc18 \uac1d\uccb4<\/strong>\ub098 <code>URLSearchParams<\/code><strong> \uac1d\uccb4<\/strong>\uc5ec\uc57c \ud55c\ub2e4. <code>URLSearchParams<\/code><strong>\uac1d\uccb4<\/strong>\ub294 \uc8fc\ub85c <code>application\/x-www-form-urlencoded<\/code> \ud3ec\ub9f7\uc744 \ubcf4\ub0b4\ub294\ub370 \uc0ac\uc6a9\ub41c\ub2e4.<br \/>\n<strong>paramsSerializer<\/strong><br \/>\nparams\uc758 \uc2dc\ub9ac\uc5bc\ub77c\uc774\uc988\ub97c \uc5b4\ub5bb\uac8c \ucc98\ub9ac\ud560 \uc9c0 \uc124\uc815\ud574\uc8fc\ub294 \uc120\ud0dd\uc635\uc158\uc774\ub2e4.<br \/>\n**data<br \/>\n<strong>data\ub294 \uc694\uccad \ubcf8\ubb38\uc73c\ub85c \uc804\uc1a1\ud560 \ub370\uc774\ud130\uc774\uace0 <code>PUT<\/code>,  <code>POST<\/code>,  <code>PATCH<\/code><\/strong> **\uba54\uc11c\ub4dc\uc5d0\ub9cc \uc801\uc6a9\uac00\ub2a5\ud558\ub2e4. transformRequst \uac00 \uc124\uc815\ub418\uc9c0 \uc54a\uc740 \uacbd\uc6b0 \ub2e4\uc74c \uc720\ud615 \uc911 \ud558\ub098\uc5ec\uc57c \ud55c\ub2e4.<br \/>\n<code>string<\/code>, <code>plain object<\/code>, <code>ArrayBuffer<\/code>, <code>ArrayBufferView<\/code>, <code>URLSearchParams<\/code>, <code>FormData<\/code>, <code>File<\/code>, <code>Blob<\/code>, \uc544\ub798\uc640 \uac19\uc774 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios({\n\tmethod: &quot;POST&quot;,\n\turl: &quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;\n\theaders : {\n\t\t&quot;Content-Type&quot; : &quot;application\/json&quot;,\n\t},\n\tdata: (\uc5c5\ub85c\ub4dc\ud560 \ub370\uc774\ud130) \/\/ \uc704\uc5d0 \uc124\uba85\ud55c \uc720\ud615 \uc911 \ud558\ub098\uc5ec\uc57c \ud55c\ub2e4.\n})\n<\/code><\/pre>\n<p><strong>withCredentials<\/strong><br \/>\n\uae30\ubcf8\uac12\uc740 <strong><code>false<\/code><\/strong> \uc774\uace0 \uc790\uaca9 \uc99d\uba85\uc744 \uc0ac\uc6a9\ud558\uc5ec CORS \uc694\uccad\uc774 \ud544\uc694\ud55c \uacbd\uc6b0 \uc124\uc815\ud55c\ub2e4.<br \/>\n<strong>responseType<\/strong><br \/>\n\uc11c\ubc84\uc5d0\uc11c \uc751\ub2f5\ud560 \ub370\uc774\ud130 \ud0c0\uc785\uc744 \uc124\uc815\ud55c\ub2e4. \uae30\ubcf8\uac12\uc740<strong> <strong><strong><code>json<\/code><\/strong><\/strong> <strong>\uc774\uace0 <code>arraybuffer<\/code>, <code>blob<\/code>, <code>document<\/code>, <code>json<\/code>, <code>text<\/code>, <code>stream<\/code><\/strong>  <\/strong>\uc774 \uc788\ub2e4.<br \/>\n<strong>timeout<\/strong><br \/>\n\uc694\uccad\uc774 \ud0c0\uc784 \uc544\uc6c3\ub418\ub294 \ubc00\ub9ac \ucd08(ms)\ub97c \uc124\uc815\ud55c\ub2e4. \uc694\uccad\uc774 \uc124\uc815 \uc2dc\uac04\ubcf4\ub2e4 \uc9c0\uc5f0 \ub420 \uacbd\uc6b0, \uc694\uccad\uc740 \uc911\ub2e8\ub41c\ub2e4.<br \/>\n\uae30\ubcf8\uac12\uc740 0\uc774\ub2e4. (\ud0c0\uc784\uc544\uc6c3 \uc5c6\uc74c)<\/p>\n<h4>8.1.2 Config \uc804\uc5ed \uae30\ubcf8\uac12 \uc124\uc815<\/h4>\n<p>\ubaa8\ub4e0 \uc694\uccad\uc5d0 \uc801\uc6a9\ub418\ub294 config \uae30\ubcf8\uac12\ub4e4\uc744 \uc124\uc815\ud560 \uc218 \uc788\ub2e4.<br \/>\n\uc544\ub798\uc640 \uac19\uc774 \uc0ac\uc6a9\ud574\uc11c \uc694\uccad config\uc758 \uae30\ubcf8\uac12\uc744 \uc124\uc815\ud574\uc11c \ubc18\ubcf5\uc801\uc73c\ub85c \uc4f0\uc9c0 \uc54a\uace0 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios.defaults.baseURL = &#39;https:\/\/jsonplaceholder.typicode.com&#39;;\naxios.defaults.headers.common[&#39;Authorization&#39;] = &#39;test&#39;;\n\taxios({\n\t  url: &quot;\/posts\/1&quot;\n\t}).then(response =&gt; console.log(response));\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/28.png\" alt=\"\"><\/p>\n<p>\uae30\ubcf8\uac12\uc73c\ub85c <code>baseURL<\/code> \uc640 <code>headers<\/code> \uc758 <code>Authorization<\/code> \uac12\uc744 \uc124\uc815\ud574\uc8fc\uace0 URL\ub9cc \ub123\uc5b4\uc11c \uc694\uccad\ud574\uc8fc\uba74 \uc0ac\uc9c4\uacfc \uac19\uc774 \uc124\uc815\uac12\uc73c\ub85c \uc694\uccad\uc774 \uac00\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. <code>baseURL<\/code>\uc744 \uc124\uc815\ud558\uace0 URL\uc5d0\uc11c \uacbd\ub85c\ub97c \ub2e4\ub974\uac8c \ub123\uc5b4\uc904 \uc218\ub3c4 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios.defaults.baseURL = &#39;https:\/\/jsonplaceholder.typicode.com&#39;;\n\taxios({\n\t  url: &quot;https:\/\/mandarin.api.weniv.co,kr\/user&quot;\n\t}).then(response =&gt; console.log(response));\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/29.png\" alt=\"\"><\/p>\n<p>baseURL\ub300\uc2e0 URL \uc5d0 \uc785\ub825\ud55c \uac12\uc73c\ub85c \uc694\uccad\uc744 \ubcf4\ub0b4\uace0 \uac12\uc774 \ub2e4\ub978 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. \ub610\ud55c \uc544\ub798\ucc98\ub7fc <code>axios.create<\/code> \ub85c \uc0dd\uc131\ud55c \uc778\uc2a4\ud134\uc2a4\uc5d0\ub3c4 \uc124\uc815\ud574\uc11c \uc0ac\uc6a9\ud560 \uc218\uc788\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">const instance = axios.create({\n\tbaseURL: &quot;https:\/\/jsonplaceholder.typicode.com&quot;\n});\ninstance.defaults.timeout = 2500;\ninstance.get(&#39;\/posts\/1&#39;).then(response =&gt; console.log(response));\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/30.png\" alt=\"\"><\/p>\n<p>\ucc98\uc74c instance\ub97c \uc0dd\uc131\ud560 \ub54c \uc124\uc815\ud55c baseURL\uc640 \ub098\uc911\uc5d0 \uc124\uc815\ud574\uc900 timeout\uc774 \ub4e4\uc5b4\uac04 \uacb0\uacfc\ub97c \ud655\uc778\ud560 \uc218 \uc788\ub2e4. <strong>config \uc124\uc815<\/strong>\uc758 \uc801\uc6a9\uc5d0\ub294 <strong>\uc6b0\uc120\uc21c\uc704<\/strong>\uac00 \uc874\uc7ac\ud558\ub294\ub370 <strong>\uc694\uccad config, \uc0dd\uc131\ud55c \uc778\uc2a4\ud134\uc2a4\uc758 \uae30\ubcf8\uac12, \ucd08\uae30\uc124\uc815\uc758 \uae30\ubcf8\uac12 <strong>\uc804\uc790\ubd80\ud130<\/strong> <\/strong>\uc21c\uc11c\ub300\ub85c \uc6b0\uc120\uc21c\uc704\uac00 \ub192\ub2e4. \uc704 \uc608\uc81c\uc5d0\uc11c \uc81c\uc77c \uc6b0\uc120\uc21c\uc704\uac00 \ub192\uc740 \uc694\uccad config \ub0b4\uc758 \uc124\uc815\uac12\uc73c\ub85c timeout \uac12\uc744 \uc870\uc815\ud574\ubcf4\uaca0\ub2e4. \uc790\uc138\ud55c \uc6b0\uc120\uc21c\uc704\ub294 axios \uae43\ud5d9\uc5d0\uc11c \ucc38\uace0 <a href=\"https:\/\/github.com\/axios\/axios\/blob\/v1.x\/lib\/defaults\/index.js\">[8.1.2]<\/a> \ud560 \uc218 \uc788\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">const instance = axios.create({\n\tbaseURL: &quot;https:\/\/jsonplaceholder.typicode.com&quot;\n});\ninstance.defaults.timeout = 2500;\ninstance.get(&#39;\/posts\/1&#39;,{\n\ttimeout: 4000\n}).then(response =&gt; console.log(response));\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/31.png\" alt=\"\"><\/p>\n<p>\ubc14\uafd4\uc900 \ub300\ub85c timeout\uc758 \uac12\uc774 <strong>4000<\/strong>\uc73c\ub85c \uc124\uc815\ub41c \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n<h3>8.2 Axios \uc751\ub2f5 \uc2a4\ud0a4\ub9c8<\/h3>\n<h4>8.2.1 \uc694\uccad\ud588\uc744 \ub54c \uc751\ub2f5 \uc2a4\ud0a4\ub9c8 \uc885\ub958 \ubc0f \uc608\uc81c [1]<\/h4>\n<pre><code class=\"language-javascript\">const getData = () =&gt; {\n\taxios\n\t\t.get(&quot;https:\/\/exampleURL\/user&quot;)\n\t\t.then(function (response) {\n\t\t\tconsole.log(response);\n\t});\n};\n\ngetData();\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/32.png\" alt=\"\"><\/p>\n<p>\ucf54\ub4dc\ub97c \ubcf4\uba74 response\ub97c console.log\ub85c \ucc0d\uc740 \uac83\uc744 \ubcfc \uc218 \uc788\ub2e4. console \ucc3d\uc744 \ud655\uc778\ud574 \ubcf4\uba74 6\uac00\uc9c0\uc758 axios \uc751\ub2f5 \uc2a4\ud0a4\ub9c8\uac00 \ucd9c\ub825\ub418\uc5c8\ub2e4.<\/p>\n<ul>\n<li>config : \uc694\uccad\uc744 \uc704\ud55c Axios\uac00 \uc81c\uacf5\ud558\ub294 \uad6c\uc131\uc774\ub2e4.<\/li>\n<li>data : \uc11c\ubc84\uac00 \uc81c\uacf5\ud558\ub294 \uc751\ub2f5 \ub370\uc774\ud130\uc774\ub2e4.<\/li>\n<li>headers : HTTP \ud5e4\ub354\uc774\ub2e4. \ubaa8\ub4e0 \ud5e4\ub354 \uc774\ub984\uc740 \uc18c\ubb38\uc790\uc774\uace0, \uad04\ud638 \ud45c\uae30\ubc95\uc73c\ub85c \uc811\uadfc\uc774 \uac00\ub2a5\ud558\ub2e4. \uc608\ub85c <code>response.headers[&quot;content-type&quot;]<\/code><\/li>\n<li>request : \uc751\ub2f5\uc73c\ub85c \uc0dd\uc131\ub41c \uc694\uccad\uc774\ub2e4. node.js\uc5d0\uc11c \ub9c8\uc9c0\ub9c9 ClientRequest \uc778\uc2a4\ud134\uc2a4\uace0 \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c XMLHttpRequest\uc774\ub2e4.<\/li>\n<li>status : status\ub294 HTTP \uc0c1\ud0dc \ucf54\ub4dc\uc774\ub2e4. HTTP \uc0c1\ud0dc \ucf54\ub4dc\ub294 HTTP \uacf5\uc2dd \ubb38\uc11c[2] \ub610\ub294 \uc55e\uc120 HTTP \uc751\ub2f5 \ubd80\ubd84\uc744 \ud655\uc778\ubc14\ub780\ub2e4.<\/li>\n<li>statusText : HTTP \uc0c1\ud0dc \ucf54\ub4dc\uc5d0 \ub300\ud55c \uba54\uc138\uc9c0\uc774\ub2e4.<\/li>\n<\/ul>\n<h2>9. Axios \uc0ac\uc6a9\ud574\ubcf4\uae30<\/h2>\n<h3>9.1 GET \uc694\uccad<\/h3>\n<h4>9.1.1 Axios\uc758 GET\uc774\ub780?<\/h4>\n<p><code>Axios<\/code>\uc758 <code>GET<\/code>\uc740 \uc55e\uc11c <code>Fetch<\/code>\uc5d0\uc11c \uc5b8\uae09\ud55c <code>GET<\/code>\uacfc \ub3d9\uc77c\ud55c <strong>RESTful API<\/strong> \uae30\ubc18 \uba54\uc11c\ub4dc\ub85c, <code>Axios<\/code>\uc5d0 \ub0b4\uc7a5\ub418\uc5b4 \uc788\ub2e4. <strong>\ub370\uc774\ud130\ub97c \uac00\uc838\uc62c \ub54c(Read) <\/strong>\uc0ac\uc6a9\ud55c\ub2e4. <\/p>\n<h4>9.1.2 \uc0ac\uc6a9 \ubc29\ubc95<\/h4>\n<p>\uae30\ubcf8\uc73c\ub85c \uc0ac\uc6a9\ud558\ub294 \ubb38\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios({\n  method: &quot;GET&quot;,\n  url: &quot;url&quot;,\n});\n<\/code><\/pre>\n<p>\ubcc4\uce6d \uba54\uc18c\ub4dc \uc0ac\uc6a9\uc2dc \ub2e8\ucd95 \ubb38\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4. <code>url<\/code> \uc5d0\ub294 \uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c , <code>config<\/code> \uc5d0\ub294 request header\ub97c \ud30c\ub77c\ubbf8\ud130\ub85c \ub123\uc5b4\uc900\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">axios.get(url[, config]) \n<\/code><\/pre>\n<pre><code class=\"language-javascript\">axios.get(&quot;\uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c&quot;, request header)\n<\/code><\/pre>\n<h4>9.1.3 \uc2e4\uc2b5 \uc608\uc81c<\/h4>\n<p>Fetch\uc5d0\uc11c\uc758 \uc2e4\uc2b5\uacfc \ub3d9\uc77c\ud558\uac8c <a href=\"https:\/\/jsonplaceholder.typicode.com\/\">https:\/\/jsonplaceholder.typicode.com\/<\/a>\uc5d0\uc11c posts\uc758 1\ubc88 \uac8c\uc2dc\ubb3c\uc744 \uac00\uc838\uc640 \ubcf4\uc790.<\/p>\n<p><strong>\uc608\uc81c1. \uc694\uccad \ud30c\ub77c\ubbf8\ud130\ub97c \uc0ac\uc6a9\ud55c Axios GET<\/strong><\/p>\n<pre><code class=\"language-javascript\">axios({\n\t\tmethod: &quot;get&quot;,\n\t\turl: &quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,\n\t\theaders: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n\t})\n  .then(function (response) {\n\t\tconsole.log(response);\n  })\n\t.catch(function(error){\n\t\tconsole.log(error);\n\t})\n<\/code><\/pre>\n<p><strong>\uc608\uc81c2. \ub2e8\ucd95 \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud55c Axios GET<\/strong><\/p>\n<pre><code class=\"language-javascript\">\naxios.get(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,{\n  headers: {\n      &quot;Content-Type&quot;: &quot;application\/json&quot;,\n    },\n  }\n)\n\t.then(function(response){\n\t\tconsole.log(response);\n})\n\t.catch(function(error){\n\t\tconsole.log(error);\n})\n<\/code><\/pre>\n<p><strong>\uc608\uc81c3 . async\/await\uc744 \uc0ac\uc6a9\ud55c Axios GET <\/strong><\/p>\n<pre><code class=\"language-javascript\">async function axiosGet() {\n\ttry{\n\t\tconst response= await axios.get(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,{\n\t\t  headers: {\n\t      &quot;Content-Type&quot;: &quot;application\/json&quot;,\n\t      }\n     })\n\t\t  console.log(response);\n    }\n    catch (error){\n      console.log(error);\n\t\t}\n\t}\naxiosGet();\n<\/code><\/pre>\n<p><strong>\uc608\uc81c4. async\/await\uc73c\ub85c\ub9cc\ub4e0 \ud568\uc218\ub97c \ud638\ucd9c \ud6c4 then\uc73c\ub85c \uacb0\uacfc \ucd9c\ub825\ud55c Axios GET<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function getData(url=&#39;&#39;) {\n\ttry {\n\t\tconst response = await axios(url, {\n\t\t\tmethod: &#39;get&#39;\n\t\t});\n\t\tconsole.log(response);\n\t\treturn response;\n\t} catch (error) {\n\t\tconsole.log(error);\n\t}\n}\n\ngetData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;)\n\t.then((response) =&gt; {\n\t\tconsole.log(response);\n\t});\n<\/code><\/pre>\n<p>\uc704 \uc608\uc81c\ub4e4\uc758 \uacb0\uacfc \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/33.png\" alt=\"\"><\/p>\n<h3>9.2 POST \uc694\uccad<\/h3>\n<h4>9.2.1 Axios\uc758 POST\ub780?<\/h4>\n<p><code>Axios<\/code>\uc758 <code>POST<\/code>\ub294 \uc55e\uc11c <code>fetch<\/code>\uc5d0\uc11c \uc0b4\ud3b4\ubcf4\uc558\ub358 <code>POST<\/code>\uc640 \ub3d9\uc77c\ud55c <strong>RESTful API<\/strong> \uae30\ubc18\uc758 \uba54\uc11c\ub4dc\ub85c, <code>Axios<\/code> API\uc5d0\ub3c4 \ub0b4\uc7a5\ub418\uc5b4 \uc788\ub2e4. \uc11c\ubc84\uc5d0 \ube44\uad50\uc801 \uc6a9\ub7c9\uc774 \ud070 \ub370\uc774\ud130\ub97c \uc804\uc1a1\ud558\uac70\ub098 \ud574\ub2f9 \ub370\uc774\ud130\ub97c url\uc5d0 \ub098\ud0c0\ub0b4\uc9c0 \uc54a\uace0 \uc804\uc1a1\ud560 \ub54c \uc0ac\uc6a9\ud55c\ub2e4.<br \/>\n<code>fetch<\/code>\uc640 \ube44\uad50\ud574\ubcf4\uba74, <code>JSON<\/code> \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uc544\ub3c4 \ub418\ub294 \uc810, \uc694\uccad \ud5e4\ub354\uac00 \uc790\ub3d9\uc73c\ub85c \uc124\uc815\ub418\ub294 \uc810 \ub355\ubd84\uc5d0 \ud6e8\uc52c \uac04\uacb0\ud55c \ubb38\ubc95\uacfc \ud3b8\ub9ac\ud568\uc744 \uc5ff\ubcfc\uc218 \uc788\ub2e4. \uc544\ub798 \uc608\uc81c\ub85c \uc0b4\ud3b4\ubcf4\uc790.<\/p>\n<h4>9.2.2 \uc0ac\uc6a9 \ubc29\ubc95<\/h4>\n<p>\uae30\ubcf8\uc73c\ub85c \uc0ac\uc6a9\ud558\ub294 \ubb38\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios({\n  method: &quot;POST&quot;, \/\/ \uc694\uccad \ubc29\ubc95\n  url: &quot;url&quot;, \/\/ \uc694\uccad\ud560 \uc11c\ubc84 \uc8fc\uc18c\n\tdata: { } \/\/ \uc11c\ubc84\uc5d0 POST\ud558\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130\n});\n<\/code><\/pre>\n<p>\ubcc4\uce6d \uba54\uc11c\ub4dc \uc0ac\uc6a9\uc2dc \ub2e8\ucd95 \ubb38\ubc95\uc740 \uc544\ub798\uc640 \uac19\ub2e4. \uc694\uccad\ud560 \uc11c\ubc84 \uc8fc\uc18c\uc778 <code>url<\/code>, \uc11c\ubc84\uc5d0 \uc804\uc1a1\ud558\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130, <code>config<\/code> \uc5d0\ub294 request \ud5e4\ub354\ub97c \uac01\uac01 \ud30c\ub77c\ubbf8\ud130\ub85c \ub123\uc5b4\uc8fc\uba74 \ub41c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios.post(url[, data[, config]])\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">axios.post(&quot;\uc694\uccad\ud560 \uc11c\ubc84 url&quot;, \uc11c\ubc84\uc5d0 POST\ud558\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130, request \ud5e4\ub354)\n<\/code><\/pre>\n<h4>9.2.3 \uc2e4\uc2b5 \uc608\uc81c<\/h4>\n<p>Fetch\uc5d0\uc11c\uc758 \uc2e4\uc2b5\uacfc \ub3d9\uc77c\ud558\uac8c POST\ub97c \uc774\uc6a9\ud558\uc5ec \uc544\ub798\uc640 \uac19\uc740 \ub370\uc774\ud130\ub97c <a href=\"https:\/\/jsonplaceholder.typicode.com\/posts\">https:\/\/jsonplaceholder.typicode.com\/posts<\/a> \uc5d0 \uc0dd\uc131\ud558\ub294 \uc2e4\uc2b5\uc744 \ud574 \ubcf4\uc790.<\/p>\n<pre><code class=\"language-javascript\">const postTestData = {\n    title: &quot;Post test&quot;,\n\t\tbody: &quot;axios\uc758 Post \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n\t\tuserId: 2,\n};\n<\/code><\/pre>\n<p><strong>\uc608\uc81c1. \uc694\uccad \ud30c\ub77c\ubbf8\ud130\ub97c \uc0ac\uc6a9\ud55c Axios POST<\/strong><\/p>\n<pre><code class=\"language-javascript\">axios({\n\t\tmethod: &quot;post&quot;,\n\t\turl: &quot;https:\/\/jsonplaceholder.typicode.com\/posts\/&quot;,\n\t\theaders: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n\t\tdata: postTestData,\n\t})\n\t.then(function (response) {\n\t\tconsole.log(response);\n\t.catch(function(error){\n\t\tconsole.log(error)\n\t})\n<\/code><\/pre>\n<p><strong>\uc608\uc81c2. \ub2e8\ucd95 \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud55c Axios POST<\/strong><\/p>\n<pre><code class=\"language-javascript\">axios.post(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/&quot;,\n\tpostTestData,\n\t{headers: {\n\t\t&quot;Content-Type&quot;: &quot;application\/json&quot;,\n\t\t},\n\t})\n\t.then(function (response) {\n\t\tconsole.log(response)\n\t})\n\t.catch(function (error) {\n\t\tconsole.log(error)\n\t})\n<\/code><\/pre>\n<p><strong>\uc608\uc81c3 . async\/await\uc744 \uc0ac\uc6a9\ud55c Axios POST<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function axiosPost() {\n\ttry {\n\t\tconst response = await axios.post(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;, \n\t\t\tpostTestData, \n\t\t\t{headers: {\n\t\t\t\t&quot;Content-Type&quot;: &quot;application\/json&quot;,\n\t\t\t\t},\n\t\t});\n\t\tconsole.log(response.data);\n\t} catch (error) {\n\t\tconsole.error(error.message);\n\t}\n}\n\naxiosPost();\n<\/code><\/pre>\n<p>\ub610\ud55c \uc55e\uc11c \uac04\ub2e8\ud788 \uc5b8\uae09\ud55c \ubc14\uc640 \uac19\uc774, \ub9cc\uc57d <code>content-type<\/code> \ud5e4\ub354\ub97c \ubcc4\ub3c4\ub85c \uc9c0\uc815\ud574\uc8fc\uc9c0 \uc54a\uc544\ub3c4 \uc790\ub3d9\uc801\uc73c\ub85c <code>application\/json<\/code> \uc73c\ub85c \uc124\uc815\ud574\uc8fc\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">async function axiosPost2(){\n\ttry {\n\tconst response = await axios.post(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;, postTestData);\n\tconsole.log(response.data);\n\tconsole.log(response.headers[&quot;content-type&quot;]); \/\/ &quot;application\/json;charset=utf-8&quot;\n} catch(error){\n\tconsole.error(error.message);\n}\n\n\naxiosPost2();\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/34.png\" alt=\"\"><\/p>\n<p><strong>\uc608\uc81c4. async\/await\uc73c\ub85c\ub9cc\ub4e0 \ud568\uc218\ub97c \ud638\ucd9c \ud6c4 then\uc73c\ub85c \uacb0\uacfc \ucd9c\ub825\ud55c Axios POST<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function postData(url=&quot;&quot;, data={}) {\n\ttry {\n\t\tconst response = await axios.post(url, data);\n\t\tconsole.log(response);\n\t} catch (error) {\n\t\tconsole.log(error);\n\t}\n}\n\npostData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts&quot;, postTestData)\n.then((response) =&gt; {\n\t\tconsole.log(response);\n});\n<\/code><\/pre>\n<p>\uc704 \uc608\uc81c\ub4e4\uc758 \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/35.png\" alt=\"\"><\/p>\n<ul>\n<li><strong>\uc804\uc1a1\ud558\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130\uac00 \uc774\ubbf8\uc9c0 \ud639\uc740 \uc601\uc0c1\uc778 \uacbd\uc6b0<\/strong><br \/>\nrequest \ud5e4\ub354\uc758 <code>content-type<\/code> \uac12\uc774 <code>multipart\/form-data<\/code> \ub85c \uc790\ub3d9\uc801\uc73c\ub85c \uc124\uc815\ub418\uc9c0\ub9cc, \ub9cc\uc77c \ub370\uc774\ud130\uac00 \uc81c\ub300\ub85c \uc804\uc1a1\ub418\uc9c0 \uc54a\ub294 \uc5d0\ub7ec\ub97c \ub300\ube44\ud558\uc5ec \ud55c\ubc88 \ub354 \uc9c0\uc815\ud574\uc8fc\ub294 \uac83\uc774 \uad8c\uc7a5\ub41c\ub2e4.<\/li>\n<\/ul>\n<pre><code class=\"language-javascript\">imgConfig = {\n\theaders: {\n\t&#39;content-type&#39;: &#39;multipart\/form-data&#39;\n\t}\n}\n\nconst result = await axios.post(&#39;url&#39;, formData \uac1d\uccb4\uc5d0 \ub2f4\uae34 \uc774\ubbf8\uc9c0 \ub370\uc774\ud130, imgConfig);\n<\/code><\/pre>\n<h3>9.3 PUT \uc694\uccad<\/h3>\n<h4>9.3.1 Axios\uc758 PUT\uc774\ub780?<\/h4>\n<p><code>Axios<\/code>\uc758 <code>PUT<\/code>\uc740 \uc55e\uc11c <code>Fetch<\/code>\uc5d0\uc11c \uc5b8\uae09\ud55c <code>PUT<\/code>\uacfc \ub3d9\uc77c\ud55c <strong>RESTful API<\/strong> \uae30\ubc18 \uba54\uc11c\ub4dc\ub85c, <code>Axios<\/code>\uc5d0 \ub0b4\uc7a5\ub418\uc5b4 \uc788\ub2e4. <strong>\ub370\uc774\ud130\ub97c \uc218\uc815(Update)<\/strong>\ud560 \ub54c \uc0ac\uc6a9\ud55c\ub2e4.<\/p>\n<h4>9.3.2 \uc0ac\uc6a9\ubc29\ubc95<\/h4>\n<p>\uae30\ubcf8\uc73c\ub85c \uc0ac\uc6a9\ud558\ub294 \ubb38\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios({\n  method: &quot;PUT&quot;, \/\/ \uc804\uc1a1 \ubc29\ubc95\n  url: &quot;url&quot;, \/\/ \uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c\n  data: {data}, \/\/ \uc804\uc1a1\ud558\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130\n}).then(function (response) {\n    \/\/ response Action\n});\n<\/code><\/pre>\n<p>\ubcc4\uce6d \uba54\uc18c\ub4dc \uc0ac\uc6a9\uc2dc \ub2e8\ucd95 \ubb38\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4. <code>url<\/code> \uc5d0\ub294 \uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c, <code>data<\/code>\uc5d0\ub294 \uc804\uc1a1\ud558\uace0\uc790 \ud558\ub294 data, <code>config<\/code> \uc5d0\ub294 request header\ub97c \ud30c\ub77c\ubbf8\ud130\ub85c \ub123\uc5b4\uc900\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">axios.put(url[, data[, config]])\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">axios.put(&quot;\uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c&quot;, Put\ud558\uace0\uc790 \ud558\ub294 data, request header])\n<\/code><\/pre>\n<h4>9.3.3 \uc2e4\uc2b5 \uc608\uc81c<\/h4>\n<p>\ub2e4\uc74c\uc740 Axios PUT\uc758 \ub2e4\uc591\ud55c \uc791\uc131\ubc29\ubc95\uc774\ub2e4. <\/p>\n<p><strong>\uc608\uc81c1. \uc694\uccad \ud30c\ub77c\ubbf8\ud130\ub97c \uc0ac\uc6a9\ud55c Axios PUT<\/strong><\/p>\n<pre><code class=\"language-javascript\">axios({\n\t\tmethod: &quot;PUT&quot;,\n\t\turl: &quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,\n\t\tdata: {\n\t\t  id: 1,\n\t\t  title: &quot;Put test&quot;,\n\t\t  data: &quot;axios\uc758 Put \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n\t\t  userId: 1,\n\t\t}\n  })\n  .then(function (response) {\n\t\tconsole.log(response);\n  })\n\t.catch(function(error){\n\t\tconsole.log(error)\n})\n<\/code><\/pre>\n<p><strong>\uc608\uc81c2. \ub2e8\ucd95 \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud55c Axios PUT<\/strong><\/p>\n<pre><code class=\"language-javascript\">axios.put(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,{\n  id: 1,\n  title: &quot;Put test&quot;,\n  body: &quot;axios\uc758 Put \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n  userId: 1,\n})\n\t.then(function(response){\n\t\tconsole.log(response)\n    return response;\n})\n\t.catch(function(error){\n\t\tconsole.log(error)\n})\n<\/code><\/pre>\n<p><strong>\uc608\uc81c3. async\/await\uc744 \uc0ac\uc6a9\ud55c Axios PUT<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function axiosPut() {\n\ttry{\n    const response= await axios.put(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,{\n      id: 1,\n      title: &quot;Put test&quot;,\n      body: &quot;axios\uc758 Put \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n      userId: 1,\n    })\n    console.log(response);\n    return response;\n  }\n  catch (error){\n    console.log(error);\n  }\n}\n\n axiosPut();\n<\/code><\/pre>\n<p>**<br \/>\n\uc608\uc81c4. async\/await\uc73c\ub85c\ub9cc\ub4e0 \ud568\uc218\ub97c \ud638\ucd9c \ud6c4 then\uc73c\ub85c \uacb0\uacfc \ucd9c\ub825\ud55c Axios PUT**<\/p>\n<pre><code class=\"language-javascript\">async function putData(url = &quot;&quot;, data = {}) {\n\ttry {\n    const response = await axios\n      .put(url, data,\n      {\n        headers: {\n          &#39;Content-Type&#39;: &#39;application\/json&#39;,\n       })\n      console.log(response.data)\n      return response;\n  }\n   catch (error) {\n    console.log(error);\n  }\n}\n\nputData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n  id: 1,\n  title: &quot;Put test&quot;,\n  body: &quot;axios\uc758 Put \uba54\uc18c\ub4dc\ub97c \ud14c\uc2a4\ud2b8 \uc911\uc785\ub2c8\ub2e4.&quot;,\n  userId: 1,\n})\n\t.then((data) =&gt; {\n\t  console.log(data);\n\t});\n<\/code><\/pre>\n<p>\uc704 3\uac1c\uc758 \uc608\uc81c\uc758 \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/36.png\" alt=\"\"><\/p>\n<h3>9.4 PATCH \uc694\uccad<\/h3>\n<h4>9.4.1 Axios\uc758 PATCH\ub780?<\/h4>\n<p><code>Axios<\/code>\uc758 <code>Patch<\/code> \ub294 \uc55e\uc11c <code>Fetch<\/code>\uc5d0\uc11c \uc5b8\uae09\ud55c <code>Patch<\/code> \uc640 \ub3d9\uc77c\ud55c <strong>RESTful API<\/strong> \uae30\ubc18 \uba54\uc11c\ub4dc\ub85c, <code>Axios<\/code>\uc5d0 \ub0b4\uc7a5\ub418\uc5b4 \uc788\ub2e4. <strong>\ub370\uc774\ud130\ub97c \uc218\uc815(Update)<\/strong>\ud560 \ub54c \uc0ac\uc6a9\ud55c\ub2e4. <code>Put<\/code> \uacfc \ub2e4\ub974\uac8c \uc77c\ubd80\ubd84\ub9cc \uc218\uc815\ud560 \ub54c \uc0ac\uc6a9\ud55c\ub2e4.<\/p>\n<h4>9.4.2 \uc0ac\uc6a9\ubc29\ubc95<\/h4>\n<p>\uae30\ubcf8\uc73c\ub85c \uc0ac\uc6a9\ud558\ub294 \ubb38\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios({\n  method: &quot;PATCH&quot;, \/\/ \uc804\uc1a1 \ubc29\ubc95\n  url: &quot;url&quot;, \/\/ \uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c\n  data: {data}, \/\/ \uc804\uc1a1\ud558\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130\n})\n<\/code><\/pre>\n<p>\ubcc4\uce6d \uba54\uc18c\ub4dc \uc0ac\uc6a9\uc2dc \ub2e8\ucd95 \ubb38\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4. <code>url<\/code> \uc5d0\ub294 \uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c, <code>data<\/code>\uc5d0\ub294 \uc804\uc1a1\ud558\uace0\uc790 \ud558\ub294 data, <code>config<\/code> \uc5d0\ub294 request header\ub97c \ud30c\ub77c\ubbf8\ud130\ub85c \ub123\uc5b4\uc900\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">axios.patch(url[, data[, config]])\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">axios.patch(&quot;\uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c&quot;, Patch\ud558\uace0\uc790 \ud558\ub294 data, request header])\n<\/code><\/pre>\n<h4>9.4.3 \uc608\uc81c<\/h4>\n<p>\ub2e4\uc74c\uc740 Axios PATCH\uc758 \ub2e4\uc591\ud55c \uc791\uc131\ubc29\ubc95\uc774\ub2e4. <\/p>\n<p><strong>\uc608\uc81c1. \uc694\uccad \ud30c\ub77c\ubbf8\ud130\ub97c \uc0ac\uc6a9\ud55c Axios PATCH<\/strong><\/p>\n<pre><code class=\"language-javascript\">axios({\n  method: &quot;patch&quot;,\n  url: &quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,\n  headers: {\n    &quot;Content-Type&quot;: &quot;application\/json&quot;,\n  },\n  data: { title: &#39;patch \ud14c\uc2a4\ud2b8 \uc785\ub2c8\ub2e4.&quot; },\n})\n  .then(function (response) {\n    console.log(response);\n  })\n  .catch(function (error) {\n    console.log(error);\n  });\n<\/code><\/pre>\n<p><strong>\uc608\uc81c2. \ub2e8\ucd95 \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud55c Axios PATCH<\/strong><\/p>\n<pre><code class=\"language-javascript\">axios\n  .patch(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n    headers: {\n      &quot;Content-Type&quot;: &quot;application\/json&quot;,\n    },\n    title: &quot;patch \ud14c\uc2a4\ud2b8\uc785\ub2c8\ub2e4.&quot;,\n  })\n  .then(function (res) {\n    console.log(res);\n  })\n  .catch(function (error) {\n    console.log(error);\n  });\n<\/code><\/pre>\n<p><strong>\uc608\uc81c3. async\/await\uc744 \uc0ac\uc6a9\ud55c Axios PATCH<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function axiosPatch() {\n  try {\n    const response = await axios.patch(\n      &quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,\n      {\n        headers: {\n          &quot;Content-Type&quot;: &quot;application\/json&quot;,\n        },\n        title: &quot;patch \ud14c\uc2a4\ud2b8 \uc785\ub2c8\ub2e4.&quot;,\n      }\n    );\nconsole.log(response);\n  } catch (error) {\n    console.log(error);\n  }\n}\n\naxiosPatch();\n<\/code><\/pre>\n<p><strong>\uc608\uc81c4. async\/await\uc73c\ub85c\ub9cc\ub4e0 \ud568\uc218\ub97c \ud638\ucd9c \ud6c4 then\uc73c\ub85c \uacb0\uacfc \ucd9c\ub825\ud55c Axios PATCH<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function patchData(url = &quot;&quot;, data = {}) {\n    try {\n      const response = await axios.patch(url, data);\n      console.log(response);\n\t\t\treturn response;\n    } catch (error) {\n      console.log(error);\n    }\n}\n\n  patchData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n    title: &quot;patch \ud14c\uc2a4\ud2b8 \uc785\ub2c8\ub2e4.&quot;,\n  }).then((response) =&gt; {\n    console.log(response);\n  });\n<\/code><\/pre>\n<p>\uc704 4\uac1c\uc758 \uc608\uc81c\uc758 \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/37.png\" alt=\"\"><\/p>\n<h3>9.5 DELETE \uc694\uccad<\/h3>\n<h4>9.5.1 Axios\uc758 DELETE\ub780?<\/h4>\n<p><code>Axios<\/code>\uc758 <code>DELETE<\/code>\ub294 <code>Fetch<\/code> \uc5d0\uc11c \uc5b8\uae09\ud55c <code>DELETE<\/code> \uc640 \ub3d9\uc77c\ud55c <strong>RESTful API <\/strong>\uae30\ubc18 \uba54\uc11c\ub4dc\ub85c, <code>Axios<\/code>\uc5d0 \ub0b4\uc7a5\ub418\uc5b4 \uc788\ub2e4. url\uc5d0 \ud45c\uae30\ub41c query\ubb38\uc5d0 \ud574\ub2f9\ud558\ub294 <strong>\ub9ac\uc18c\uc2a4\ub97c \uc0ad\uc81c(Delete)<\/strong>\ud560 \ub54c \uc0ac\uc6a9\ud55c\ub2e4.<br \/>\n\ub2e4\ub978 \uba54\uc11c\ub4dc\ub4e4\uacfc \ub2ec\ub9ac DELETE\ub294 \uc77c\ubc18\uc801\uc73c\ub85c body \ubd80\ubd84\uc774 \ube44\uc5b4\uc788\ub294 \ud615\ud0dc\uc774\ub2e4. \ud558\uc9c0\ub9cc \ub9ce\uc740 \ub370\uc774\ud130\ub97c \uc694\uccad\ud560 \uacbd\uc6b0\uc5d0\ub294 \ub450 \ubc88\uc9f8 \uc778\uc790 \uac12\uc5d0 data\ub97c \ucd94\uac00\ud574\uc904 \uc218\ub3c4 \uc788\ub2e4.<\/p>\n<h4>9.5.2 \uc0ac\uc6a9\ubc29\ubc95<\/h4>\n<p>\uae30\ubcf8\uc73c\ub85c \uc0ac\uc6a9\ud558\ub294 \ubb38\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios({**\n**\tmethod: &quot;delete&quot;,  \/\/ \uc804\uc1a1 \ubc29\ubc95 &quot;delete&quot;\n\turl: &quot;url&quot;,  \/\/ \uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c\n}).then(function (response) {\n\t\/\/ response Action\n});\n<\/code><\/pre>\n<p>\ubcc4\uce6d \uba54\uc11c\ub4dc \uc0ac\uc6a9\uc2dc \ub2e8\ucd95 \ubb38\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4. <code>url<\/code> \uc5d0\ub294 \uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c , <code>config<\/code> \uc5d0\ub294 request header\ub97c \ud30c\ub77c\ubbf8\ud130\ub85c \ub123\uc5b4\uc900\ub2e4. <\/p>\n<pre><code class=\"language-javascript\">axios.delete(url[, config])\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">axios.delete(&quot;\uc5f0\uacb0\ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84 \uc8fc\uc18c&quot;, request header)\n<\/code><\/pre>\n<p>3.4.1\uc5d0\uc11c \uc5b8\uae09\ud588\ub358 \ub0b4\uc6a9\ucc98\ub7fc \ub450\ubc88\uc9f8 \uc778\uc790\uac12\uc5d0 data\ub97c \ucd94\uac00\ud574\uc11c \uc0ac\uc6a9\ud558\ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \ubc29\ubc95\ub3c4 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios.delete(&quot;url&quot;, {\n\tdata: {\n\t\tdata...\n\t}\n})\n\t.then(function (response) {\n\tconsole.log(response);\n})\n\t.catch(function (error) {\n\tconsole.log(error);\n})\n<\/code><\/pre>\n<h4>9.5.3 \uc2e4\uc2b5 \uc608\uc81c<\/h4>\n<p>Fetch\uc5d0\uc11c\uc758 \uc2e4\uc2b5\uacfc \ub3d9\uc77c\ud558\uac8c <a href=\"https:\/\/jsonplaceholder.typicode.com\/\">https:\/\/jsonplaceholder.typicode.com\/<\/a>\uc5d0\uc11c posts\uc758 1\ubc88 \uac8c\uc2dc\ubb3c\uc744 \uc0ad\uc81c\ud574\ubcf4\uc790.<\/p>\n<p><strong>\uc608\uc81c1. \uc694\uccad \ud30c\ub77c\ubbf8\ud130\ub97c \uc0ac\uc6a9\ud55c Axios DELETE<\/strong><\/p>\n<pre><code class=\"language-javascript\">axios({\n\tmethod: &quot;delete&quot;,  \/\/ &quot;delete&quot; \uba54\uc11c\ub4dc\uc758 \uc774\ub984\uc744 \uba85\uc2dc\n\turl: &quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,  \/\/ 1\ubc88 posts\uc5d0 \ub300\ud55c \uc694\uccad\n  headers: {\n\t\t&quot;Content-Type&quot;: &quot;application\/json&quot;,\n\t},\n})\n\t.then(function (response) {  \/\/ \uc751\ub2f5\n\t\tconsole.log(response); \n\t});\n<\/code><\/pre>\n<p><strong>\uc608\uc81c2 . async\/await\uc744 \uc0ac\uc6a9\ud55c Axios DELETE<\/strong><\/p>\n<pre><code class=\"language-javascript\">axios.delete(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,\n\theaders: {\n\t\t&quot;Content-Type&quot;: &quot;application\/json&quot;,\n\t},\n)\n\t.then(function (response) {  \n\t\tconsole.log(response);  \/\/ \uc131\uacf5 \uc751\ub2f5 \ucd9c\ub825\n\t})\n\t.catch(function (error) {  \n\t\tconsole.log(error);  \/\/ \uc5d0\ub7ec \uc751\ub2f5 \ucd9c\ub825\n\t})\n<\/code><\/pre>\n<p><strong>\uc608\uc81c3. \ub2e8\ucd95 \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud55c Axios DELETE<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function DeleteAxios() {\n\ttry {\n\t\tconst response = await axios.delete(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,\n\t\theaders: {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n      },\n\t\t);\n\t\tconsole.log(response);\n\t} catch (error) {\n\t\tconsole.log(error);\n\t}\n}\n<\/code><\/pre>\n<p><strong>\uc608\uc81c4. async\/await\uc73c\ub85c\ub9cc\ub4e0 \ud568\uc218\ub97c \ud638\ucd9c \ud6c4 then\uc73c\ub85c \uacb0\uacfc \ucd9c\ub825\ud55c Axios DELETE<\/strong><\/p>\n<pre><code class=\"language-javascript\">async function DeleteData(url = &quot;&quot;, data = {}) {\n        try {\n            const response = await axios(url, {\n                method: &quot;delete&quot;,\n            });\n            console.log(response);\n            return response;\n        } catch (error) {\n            console.log(error);\n        }\n    }\n\n    DeleteData(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;, {\n        id: 1,\n    }).then((response) =&gt; {\n        console.log(response);\n    });\n<\/code><\/pre>\n<p>\uc704 \uc608\uc81c\ub4e4\uc758 \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/38.png\" alt=\"\"><\/p>\n<p>\ucf58\uc194 \ucc3d\uc758 \uc751\ub2f5 \uacb0\uacfc\uc5d0\uc11c data\uac12\uc740 \ube44\uc5b4\uc788\uc9c0\ub9cc, HTTP \uc0c1\ud0dc\ucf54\ub4dc\uc778 status\uac00 200\uc774\ubbc0\ub85c delete\uac00 \uc131\uacf5\uc801\uc73c\ub85c \uc798 \ucc98\ub9ac\ub41c \uac83\uc744 \uc54c \uc218 \uc788\ub2e4.<\/p>\n<h2>10. Axios \uc131\uacf5 \uc5ec\ubd80 \ud655\uc778\ud558\uae30, \uc5d0\ub7ec \ucc98\ub9ac<\/h2>\n<h3>10.1 Axios \uc131\uacf5 \uc5ec\ubd80 \ud655\uc778\ud558\uae30<\/h3>\n<p>\ub124\ud2b8\uc6cc\ud06c \uc7a5\uc560\ub098 CORS \uc5d0\ub7ec\uc5d0 \uc758\ud574 \uc694\uccad\uc774 \uc644\ub8cc\ub418\uc9c0 \ubabb\ud55c \uacbd\uc6b0\uc5d0\ub9cc \ud504\ub85c\ubbf8\uc2a4\ub97c reject \ud558\ub294<strong> <\/strong>fetch \ud568\uc218\uc640 \ub2ec\ub9ac axios\ub97c \uc0ac\uc6a9\ud558\uac8c \ub41c\ub2e4\uba74 \uc131\uacf5 \uc5ec\ubd80\ub97c \uc27d\uac8c \ud655\uc778\ud560 \uc218 \uc788\ub2e4. \ub2e4\uc74c \ub450 \uac00\uc9c0 \uc608\uc81c\ub97c \ud1b5\ud574 \uc774\ub97c \uc54c\uc544\ubcf4\uc790.<\/p>\n<pre><code class=\"language-javascript\">axios.get(&quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;)\n  .then((response) =&gt; {\n    console.log(response);\n  })\n  .catch((error) =&gt; console.error(error));\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/39.png\" alt=\"\"><\/p>\n<pre><code class=\"language-javascript\">axios.get(&quot;https:\/\/jsonplaceholder.typicode.com\/wrong&quot;)\n  .then((response) =&gt; {\n    console.log(response);\n  })\n  .catch((error) =&gt; console.log(error));\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/40.png\" alt=\"\"><\/p>\n<p>1\ubc88 \ucf54\ub4dc\ub294 \uc815\uc0c1\uc801\uc778 URL\uc744 \uc785\ub825\ud574 <code>response<\/code>\uac00 \ucd9c\ub825\ub418\uace0, 2\ubc88 \ucf54\ub4dc\ub294 \ubd80\uc801\uc808\ud55c URL\ub97c \uc785\ub825\ud574 <code>error<\/code>\uac00 \ucd9c\ub825\ub418\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<br \/>\n\uc774\ucc98\ub7fc axios\ub294 fetch \ud568\uc218\ub97c \uc774\uc6a9\ud55c \ucf54\ub4dc\uc5d0\uc11c resolve\ud55c ok \uc0c1\ud0dc\ub97c \ud655\uc778\ud558\uace0 \uba85\uc2dc\uc801\uc73c\ub85c \uc5d0\ub7ec\ub97c \ucc98\ub9ac\ud588\ub358 \uacfc\uc815 \uc5c6\uc774 \uac04\ub2e8\ud558\uac8c \uc131\uacf5 \uc5ec\ubd80\ub97c \ud655\uc778\ud560 \uc218 \uc788\uace0, \uc5d0\ub7ec\uac00 \uc5b4\ub5a4 \uc774\uc720\ub85c \ubc1c\uc0dd\ud588\ub294\uc9c0\uc5d0 \ub300\ud574\uae4c\uc9c0 \ud310\ub2e8\ud560 \uc218 \uc788\uac8c \ud574\uc900\ub2e4.<\/p>\n<h3>10.2 \uc5d0\ub7ec \ucc98\ub9ac<\/h3>\n<p>axios\uac00 \uc815\uc0c1\uc801\uc73c\ub85c \uc791\ub3d9\ud588\uc744 \ub54c \uc694\uccad\uc5d0 \ub300\ud55c \uc751\ub2f5\uc740 6\uac00\uc9c0\uc758 \uc2a4\ud0a4\ub9c8\ub97c \uc81c\uacf5\ud55c\ub2e4. \ube44\uc815\uc0c1\uc801\uc73c\ub85c \uc791\ub3d9\ud588\uc744 \ub54c\ub3c4 \ub9c8\ucc2c\uac00\uc9c0\ub85c 6\uac00\uc9c0\uc758 \uc2a4\ud0a4\ub9c8\ub97c \uc81c\uacf5\ud558\ub294\ub370 \uc774\ub97c \uc774\uc6a9\ud574 \ub2e4\uc591\ud55c \ubc29\uc2dd\uc73c\ub85c \uc5d0\ub7ec\ub97c \ucc98\ub9ac\ud560 \uc218 \uc788\ub2e4. \uba3c\uc800 \ub2e4\uc74c \uc608\uc81c\uc5d0\uc11c \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud588\uc744 \ub54c <code>error<\/code>\ub97c \ucf58\uc194\ucc3d\uc5d0 \ucd9c\ub825\ud55c \uacb0\uacfc\ub97c \ubcf4\uc790.<\/p>\n<pre><code class=\"language-javascript\">axios.get(&quot;https:\/\/jsonplaceholder.typicode.com\/wrong&quot;)\n  .then((response) =&gt; {\n    console.log(response);\n  })\n  .catch(function (error) {\n    console.log(error);\n  });\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/41.png\" alt=\"\"><\/p>\n<p>\ucd9c\ub825 \uacb0\uacfc\uc778 <code>error<\/code> \uac1d\uccb4\uc758 <code>response<\/code>\ub97c \uc774\uc6a9\ud558\uba74 \uc11c\ubc84\uc5d0 \uc694\uccad\uc774 \uc774\ub8e8\uc5b4\uc9c0\uace0 \uc11c\ubc84\uac00 \u20182xx\u2019\ub97c \ub118\uc5b4\uac00\ub294 \uc0c1\ud0dc \ucf54\ub4dc(\u20195xx\u2019, \u20184xx\u2019)\ub85c \uc751\ub2f5\ud588\uc744 \ub54c\uc5d0 \ub300\ud574 \uc5d0\ub7ec \ucc98\ub9ac\uac00 \uac00\ub2a5\ud558\uace0, <code>request<\/code>\ub97c \uc774\uc6a9\ud558\uba74 \uc11c\ubc84\uc5d0 \uc694\uccad\uc774 \uc774\ub904\uc84c\uc73c\ub098 \uc751\ub2f5\uc744 \ubc1b\uc9c0 \ubabb\ud55c \uacbd\uc6b0\uc5d0 \ub300\ud55c \uc5d0\ub7ec \ucc98\ub9ac\uac00 \uac00\ub2a5\ud558\ub2e4. \uc774\ub97c \ub2e4\uc74c \uc608\uc81c\uc640 \uac19\uc740 \ucf54\ub4dc\ub85c \uc791\uc131\uc774 \uac00\ub2a5\ud558\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios.get(&quot;https:\/\/jsonplaceholder.typicode.com\/wrong&quot;)\n  .then((response) =&gt; {\n    console.log(response);\n  })\n  .catch(function (error) {\n    if (error.response) {\n      console.log(error.response.status);\n    } else if (error.request) {\n      console.log(error.request);\n    } else {\n\t\t\tconsole.log(error.message);\n    }\n  });\n<\/code><\/pre>\n<p><code>response<\/code>\uc640 <code>request<\/code>\ub97c \uc774\uc6a9\ud558\uae30 \uc704\ud574 if \uc870\uac74\ubb38\uc744 \uc0ac\uc6a9\ud588\uace0, \ub9c8\uc9c0\ub9c9 else\uc758 \uacbd\uc6b0 \uc694\uccad\uc744 \uc124\uc815\ud558\ub294\ub370 \ubb38\uc81c\uac00 \ubc1c\uc0dd\ud55c \uacbd\uc6b0\ub97c \ucc98\ub9ac\ud558\uac8c \ub41c\ub2e4.<br \/>\n\ub610\ud55c, axios\ub294 \uc751\ub2f5 \uc2dc\uac04\ucd08\uacfc \uc124\uc815\uc744 \uae30\ubcf8\uc801\uc73c\ub85c \uc81c\uacf5\ud55c\ub2e4. \uc774\ub97c \uc774\uc6a9\ud574 \uc694\uccad\uc744 \ud558\uace0 \uc77c\uc815 \uc2dc\uac04\uc774 \uc9c0\ub098\uba74 \uc5d0\ub7ec \ucc98\ub9ac\ub97c \ud558\ub3c4\ub85d \ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">axios({\n  method: &quot;get&quot;,\n  timeout: 1,\n  url: &quot;https:\/\/jsonplaceholder.typicode.com\/posts\/1&quot;,\n\t})\n  .then((response) =&gt; {\n    console.log(response);\n  })\n  .catch(function (error) {\n    console.log(error);\n\t});\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/42.png\" alt=\"\"><\/p>\n<p>\uc704 \uc608\uc81c\uc5d0\uc11c\ub294 axios \uc758 \uc694\uccad \ud30c\ub77c\ubbf8\ud130\uc758 <code>timeout<\/code>\uac12\uc744 1\ub85c \uc785\ub825\ud574 \uc751\ub2f5 \uc2dc\uac04\uc744 1ms\ub85c \uc124\uc815\ud588\ub2e4. \uadf8 \ub4a4 \uc608\uc2dc API\uc5d0 get \uc694\uccad\uc744 \ud558\uac8c \ub418\uba74, \ub2f9\uc5f0\ud788 \uc608\uc2dc API\ub294 1ms \uc548\uc5d0 \uc751\ub2f5\uc744 \ud560 \uc218 \uc5c6\uc73c\ubbc0\ub85c \uc2dc\uac04\uc774 \ucd08\uacfc\ub418\uc5c8\ub2e4\ub294 \uc5d0\ub7ec\ub97c \ucf58\uc194\ucc3d\uc5d0 \ucd9c\ub825\ud558\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. <\/p>\n<hr>\n<h2>11. \ucc38\uace0\uc790\ub8cc<\/h2>\n<blockquote>\n<p><em>1.[1] <em><a href=\"https:\/\/developer.mozilla.org\/ko\/docs\/Web\/API\/Fetch_API\/Basic_concepts\"><em>https:\/\/developer.mozilla.org\/ko\/docs\/Web\/API\/Fetch_API\/Basic_concepts<\/em><\/a><\/em><br \/>\n2.1.[1] <em><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Status\"><em>https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Status<\/em><\/a><\/em><br \/>\n2.1.[2] <em><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Response\"><em>https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Response<\/em><\/a><\/em><br \/>\n2.2.[1] <em><a href=\"https:\/\/fetch.spec.whatwg.org\/#fetch-method\"><em>https:\/\/fetch.spec.whatwg.org\/#fetch-method<\/em><\/a><\/em><br \/>\n2.2.[2] <em><a href=\"https:\/\/fetch.spec.whatwg.org\/#headers-class\"><em>https:\/\/fetch.spec.whatwg.org\/#headers-class<\/em><\/a><\/em><br \/>\n2.2.[3] <em><a href=\"https:\/\/fetch.spec.whatwg.org\/#request-class\"><em>https:\/\/fetch.spec.whatwg.org\/#request-class<\/em><\/a><\/em><br \/>\n3.1.[1] <em><a href=\"https:\/\/developer.mozilla.org\/ko\/docs\/Web\/API\/Fetch_API\/Using_Fetch\"><em>https:\/\/developer.mozilla.org\/ko\/docs\/Web\/API\/Fetch_API\/Using_Fetch<\/em><\/a><\/em><br \/>\n3.1.[2] <em><a href=\"https:\/\/jsonplaceholder.typicode.com\/\"><em>https:\/\/jsonplaceholder.typicode.com\/<\/em><\/a><\/em><br \/>\n3.2.[1] <em><a href=\"https:\/\/developer.mozilla.org\/ko\/docs\/Web\/HTTP\/Methods\/POST\"><em>https:\/\/developer.mozilla.org\/ko\/docs\/Web\/HTTP\/Methods\/POST<\/em><\/a><\/em><br \/>\n3.4.[1] <em><a href=\"https:\/\/developer.mozilla.org\/ko\/docs\/Web\/API\/Fetch_API\/Using_Fetch\"><em>https:\/\/developer.mozilla.org\/ko\/docs\/Web\/API\/Fetch_API\/Using_Fetch<\/em><\/a><\/em><br \/>\n3.4.[2] <em><a href=\"https:\/\/jsonplaceholder.typicode.com\/\"><em>https:\/\/jsonplaceholder.typicode.com\/<\/em><\/a><\/em><br \/>\n3.5.[1] <em><a href=\"https:\/\/developer.mozilla.org\/ko\/docs\/Web\/API\/Fetch_API\/Using_Fetch\"><em>https:\/\/developer.mozilla.org\/ko\/docs\/Web\/API\/Fetch_API\/Using_Fetch<\/em><\/a><\/em><br \/>\n3.5.[2] <em><a href=\"https:\/\/jsonplaceholder.typicode.com\/\"><em>https:\/\/jsonplaceholder.typicode.com\/<\/em><\/a><\/em><br \/>\n4.[1] <em><a href=\"https:\/\/en.wikipedia.org\/wiki\/API\"><em>https:\/\/en.wikipedia.org\/wiki\/API<\/em><\/a><\/em><br \/>\n4.[2] <em><a href=\"https:\/\/jsonplaceholder.typicode.com\/\"><em>https:\/\/jsonplaceholder.typicode.com\/<\/em><\/a><\/em><br \/>\n7.1.[1]<\/em><a href=\"https:\/\/axios-http.com\/kr\/docs\/intro\"><em>https:\/\/axios-http.com\/kr\/docs\/intro<\/em><\/a>*<br \/>\n7.1.[2] CSRF &#8211; \uc0ac\uc6a9\uc790\uac00 \uc790\uc2e0\uc758 \uc758\uc9c0\uc640\ub294 \ubb34\uad00\ud558\uac8c \uacf5\uaca9\uc790\uac00 \uc758\ub3c4\ud55c \ud589\ub3d9(\uc218\uc815, \uc0ad\uc81c, \ub4f1\ub85d \ub4f1)\uc744 \ud558\uc5ec \ud2b9\uc815 \uc6f9\uc0ac\uc774\ud2b8\uc5d0 \uc694\uccad\ud558\uac8c \ud558\ub294 \uacf5\uaca9\uc744 \ub9d0\ud55c\ub2e4.<br \/>\n7.3.[1] <em><a href=\"https:\/\/axios-http.com\/kr\/docs\/intro\"><em>https:\/\/axios-http.com\/kr\/docs\/intro<\/em><\/a><\/em><br \/>\n8.1.[1] <em><a href=\"https:\/\/github.com\/axios\/axios\/blob\/v1.x\/lib\/defaults\/index.js\"><em>https:\/\/github.com\/axios\/axios\/blob\/v1.x\/lib\/defaults\/index.js<\/em><\/a><\/em><br \/>\n8.1.[2] <em><a href=\"https:\/\/axios-http.com\/\"><em>https:\/\/jsonplaceholder.typicode.com\/<\/em><\/a><\/em><br \/>\n8.1.[3] <em><a href=\"https:\/\/github.com\/axios\/axios\/blob\/v1.x\/lib\/defaults\/index.js\">https:\/\/github.com\/axios\/axios\/blob\/v1.x\/lib\/defaults\/index.js<\/a><\/em><br \/>\n8.2.[1] <em><a href=\"https:\/\/axios-http.com\/kr\/docs\/res_schema\"><em>https:\/\/axios-http.com\/kr\/docs\/res_schema<\/em><\/a><\/em><br \/>\n8.2.[2] <em><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Status\"><em>https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Status<\/em><\/a><\/em><br \/>\n9.2.[1] *<a href=\"https:\/\/developer.mozilla.org\/ko\/docs\/Web\/API\/FormData\"><em>https:\/\/developer.mozilla.org\/ko\/docs\/Web\/API\/FormData<\/em><\/a><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>XMLHttpRequesthttps:\/\/www.mockaroo.com\/ 1. XMLHttpRequest let request = new XMLHttpRequest(); \/\/\ud1b5\uc2e0\uac1d\uccb4\uc0dd\uc131 const url = &quot;.\/MOCK_DATA.json&quot;; \/\/\uc11c\ubc84\uc8fc\uc18c\uc124\uc815 \/\/\uc751\ub2f5\uc0c1\ud0dc\ubcc4 \ucc98\ub9ac request.onreadystatechange = function () { if (request.readyState == 4 &amp;&amp; request.status == 200) { jsonfunc(this.responseText); } }; \/\/\ud1b5\uc2e0 \ubc29\uc2dd\uacfc \uc8fc\uc18c .open(&quot;GET&quot;, url) , \ud68c\uc120\uc5f0\uacb0 request.open(&quot;GET&quot;, url); \/\/\ud1b5\uc2e0\uc2e4\ud589 request.send(); \/\/\ub124\ud2b8\uc6cc\ud06c \ud1b5\uc2e0\uc73c\ub85c db \ubc1b\uae30 \/\/\ubc1b\uc740 db\ub97c \uac00\uacf5\ud574\uc11c \ud654\uba74\uc5d0 \ubc14\uc778\ub529 function jsonfunc(responseText) &#8230; <a title=\"xmlhttprequest-\ubd80\ud130axios-\uae4c\uc9c0\" class=\"read-more\" href=\"https:\/\/coalacoding.com\/?p=283\" aria-label=\"xmlhttprequest-\ubd80\ud130axios-\uae4c\uc9c0\uc5d0 \ub300\ud574 \ub354 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uc138\uc694\">\ub354 \uc77d\uae30<\/a><\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-283","post","type-post","status-publish","format-standard","hentry","category-javascript-basics"],"_links":{"self":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283"}],"version-history":[{"count":2,"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/283\/revisions"}],"predecessor-version":[{"id":2234,"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/283\/revisions\/2234"}],"wp:attachment":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}