{"id":16673,"date":"2025-01-22T11:31:39","date_gmt":"2025-01-22T08:01:39","guid":{"rendered":"https:\/\/www.itpiran.net\/blog\/?p=16673"},"modified":"2025-01-22T11:31:39","modified_gmt":"2025-01-22T08:01:39","slug":"how-to-use-the-javascript-fetch-api-to-get-data","status":"publish","type":"post","link":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/","title":{"rendered":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647"},"content":{"rendered":"<h2 id=\"%d9%85%d9%82%d8%af%d9%85%d9%87\">\u0645\u0642\u062f\u0645\u0647<\/h2>\n<p>\u0632\u0645\u0627\u0646\u06cc \u0628\u0648\u062f \u06a9\u0647 \u0627\u0632 XMLHttpRequest \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc API \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u0634\u062f. \u0634\u0627\u0645\u0644 Promises \u0646\u0628\u0648\u062f \u0648 \u06a9\u062f \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u062a\u0645\u06cc\u0632\u06cc \u0631\u0627 \u0627\u06cc\u062c\u0627\u062f \u0646\u06a9\u0631\u062f. \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 jQuery\u060c \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0633\u06cc\u0646\u062a\u06a9\u0633 \u062a\u0645\u06cc\u0632\u062a\u0631 jQuery.ajax() \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p>\u0627\u06a9\u0646\u0648\u0646\u060c \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0631\u0627\u0647 \u062f\u0627\u062e\u0644\u06cc \u062e\u0648\u062f \u0631\u0627 \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc API \u062f\u0627\u0631\u062f. \u0627\u06cc\u0646 Fetch API \u0627\u0633\u062a\u060c \u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f \u062c\u062f\u06cc\u062f\u06cc \u0628\u0631\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0633\u0631\u0648\u0631 \u0628\u0627 Promises\u060c \u0627\u0645\u0627 \u0634\u0627\u0645\u0644 \u0648\u06cc\u0698\u06af\u06cc\u200c\u0647\u0627\u06cc \u0627\u0636\u0627\u0641\u06cc \u0646\u06cc\u0632 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/p>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634\u060c \u0634\u0645\u0627 \u0647\u0631 \u062f\u0648 \u062f\u0631\u062e\u0648\u0627\u0633\u062a GET \u0648 POST \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Fetch API \u0627\u06cc\u062c\u0627\u062f \u062e\u0648\u0627\u0647\u06cc\u062f \u06a9\u0631\u062f.<\/p>\n<h5 id=\"%d9%be%db%8c%d8%b4-%d9%86%db%8c%d8%a7%d8%b2%d9%87%d8%a7\">\u067e\u06cc\u0634 \u0646\u06cc\u0627\u0632\u0647\u0627<\/h5>\n<ul>\n<li>\u06cc\u06a9 \u0645\u062d\u06cc\u0637 \u062a\u0648\u0633\u0639\u0647 \u0645\u062d\u0644\u06cc \u0628\u0631\u0627\u06cc Node.js.<\/li>\n<li>\u062f\u0631\u06a9 \u0627\u0648\u0644\u06cc\u0647 \u0627\u0632 \u06a9\u062f\u0646\u0648\u06cc\u0633\u06cc \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a.<\/li>\n<li>\u062f\u0631\u06a9 Promises \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a.<\/li>\n<\/ul>\n<h2 id=\"%d9%85%d8%b1%d8%ad%d9%84%d9%87-1-%d8%b4%d8%b1%d9%88%d8%b9-%d8%a8%d8%a7-fetch-api-syntax\">\u0645\u0631\u062d\u0644\u0647 1 &#8211; \u0634\u0631\u0648\u0639 \u0628\u0627 Fetch API Syntax<\/h2>\n<p>\u06cc\u06a9\u06cc \u0627\u0632 \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Fetch API\u060c \u0627\u0631\u0633\u0627\u0644 fetch() URL API \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u0627\u0633\u062a:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>fetch(url)\r\n<\/code><\/pre>\n<\/div>\n<p>\u0645\u062a\u062f fetch() \u06cc\u06a9 Promise \u0628\u0631\u0645\u06cc \u06af\u0631\u062f\u0627\u0646\u062f. \u0628\u0639\u062f \u0627\u0632 \u0645\u062a\u062f fetch() \u0645\u062a\u062f Promise \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f then():<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>fetch(url)\r\n.then(function() {\r\n\/\/ handle the response\r\n})<\/code><\/pre>\n<\/div>\n<p>\u0627\u06af\u0631 Promise \u0628\u0631\u06af\u0631\u062f\u0627\u0646\u062f\u0647 \u0634\u062f\u0647 \u062d\u0644 \u0634\u0648\u062f\u060c \u062a\u0627\u0628\u0639 \u062f\u0631\u0648\u0646 \u0645\u062a\u062f then() \u0627\u062c\u0631\u0627 \u0645\u06cc \u0634\u0648\u062f. \u0627\u06cc\u0646 \u062a\u0627\u0628\u0639 \u062d\u0627\u0648\u06cc \u06a9\u062f\u06cc \u0628\u0631\u0627\u06cc \u0645\u062f\u06cc\u0631\u06cc\u062a \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a\u06cc \u0627\u0632 API \u0627\u0633\u062a.<\/p>\n<p>\u0628\u0639\u062f \u0627\u0632 \u0645\u062a\u062f then() \u0645\u062a\u062f catch() \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>fetch(url)\r\n.then(function() {\r\n\/\/ handle the response\r\n})\r\n.catch(function() {\r\n\/\/ handle the error\r\n});<\/code><\/pre>\n<\/div>\n<p>API \u06a9\u0647 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 fetch() \u0641\u0631\u0627 \u0645\u06cc\u200c\u062e\u0648\u0627\u0646\u06cc\u062f \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u062e\u0631\u0627\u0628 \u0628\u0627\u0634\u062f \u06cc\u0627 \u062e\u0637\u0627\u0647\u0627\u06cc \u062f\u06cc\u06af\u0631\u06cc \u0631\u062e \u062f\u0647\u062f. \u0627\u06af\u0631 \u0627\u06cc\u0646 \u0627\u062a\u0641\u0627\u0642 \u0628\u06cc\u0641\u062a\u062f\u060c \u0642\u0648\u0644 \u0631\u062f \u0634\u062f\u0647 \u0645\u0633\u062a\u0631\u062f \u0645\u06cc \u0634\u0648\u062f. \u0631\u0648\u0634 catch \u0628\u0631\u0627\u06cc \u0631\u0633\u06cc\u062f\u06af\u06cc \u0628\u0647 \u0631\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u0634\u0648\u062f. \u0627\u06af\u0631 \u0647\u0646\u06af\u0627\u0645 \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc API \u0645\u0648\u0631\u062f \u0646\u0638\u0631 \u0634\u0645\u0627 \u062e\u0637\u0627\u06cc\u06cc \u0631\u062e \u062f\u0647\u062f\u060c \u06a9\u062f \u062f\u0631\u0648\u0646 catch() \u0627\u062c\u0631\u0627 \u062e\u0648\u0627\u0647\u062f \u0634\u062f.<\/p>\n<p>\u0628\u0627 \u062f\u0631\u06a9 \u0646\u062d\u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Fetch API\u060c \u0627\u06a9\u0646\u0648\u0646 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 fetch() \u0631\u0648\u06cc \u06cc\u06a9 API \u0648\u0627\u0642\u0639\u06cc \u0628\u0631\u0648\u06cc\u062f.<\/p>\n<h2 id=\"%d9%85%d8%b1%d8%ad%d9%84%d9%87-2-%d8%a7%d8%b3%d8%aa%d9%81%d8%a7%d8%af%d9%87-%d8%a7%d8%b2-fetch-%d8%a8%d8%b1%d8%a7%db%8c-%d8%af%d8%b1%db%8c%d8%a7%d9%81%d8%aa-%d8%af%d8%a7%d8%af%d9%87-%d8%a7\">\u0645\u0631\u062d\u0644\u0647 2 &#8211; \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Fetch \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647 \u0627\u0632 \u06cc\u06a9 API<\/h2>\n<p>\u0646\u0645\u0648\u0646\u0647 \u06a9\u062f \u0632\u06cc\u0631 \u0628\u0631 \u0627\u0633\u0627\u0633 JSONPlaceholder API \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f. \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 API\u060c \u062f\u0647 \u06a9\u0627\u0631\u0628\u0631 \u062f\u0631\u06cc\u0627\u0641\u062a \u062e\u0648\u0627\u0647\u06cc\u062f \u06a9\u0631\u062f \u0648 \u0622\u0646\u0647\u0627 \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u062f\u0631 \u0635\u0641\u062d\u0647 \u0646\u0645\u0627\u06cc\u0634 \u0645\u06cc \u062f\u0647\u06cc\u062f. \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0631\u0627 \u0627\u0632 JSONPlaceholder API \u0628\u0627\u0632\u06cc\u0627\u0628\u06cc \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u062f\u0631 \u0645\u0648\u0627\u0631\u062f \u0641\u0647\u0631\u0633\u062a \u062f\u0631 \u0641\u0647\u0631\u0633\u062a \u0646\u0648\u06cc\u0633\u0646\u062f\u0647 \u0646\u0645\u0627\u06cc\u0634 \u0645\u06cc\u200c\u062f\u0647\u062f.<\/p>\n<p>\u0628\u0627 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u0641\u0627\u06cc\u0644 HTML \u0648 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u0646 \u06cc\u06a9 \u0639\u0646\u0648\u0627\u0646 \u0648 \u0644\u06cc\u0633\u062a \u0646\u0627\u0645\u0631\u062a\u0628 \u0628\u0627 \u0634\u0646\u0627\u0633\u0647 \u0646\u0648\u06cc\u0633\u0646\u062f\u06af\u0627\u0646 \u0634\u0631\u0648\u0639 \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;h1&gt;Authors&lt;\/h1&gt;\r\n&lt;ul id=\"authors\"&gt;&lt;\/ul&gt;<\/code><\/pre>\n<\/div>\n<p>\u062a\u06af \u0647\u0627\u06cc \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0631\u0627 \u0628\u0647 \u067e\u0627\u06cc\u06cc\u0646 \u0641\u0627\u06cc\u0644 HTML \u062e\u0648\u062f \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u0648 \u0627\u0632 \u06cc\u06a9 \u0627\u0646\u062a\u062e\u0627\u0628\u06af\u0631 DOM \u0628\u0631\u0627\u06cc \u06af\u0631\u0641\u062a\u0646 ul \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f. \u0627\u0632 getElementById \u0628\u0627 \u0646\u0648\u06cc\u0633\u0646\u062f\u06af\u0627\u0646 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0622\u0631\u06af\u0648\u0645\u0627\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;h1&gt;Authors&lt;\/h1&gt;\r\n&lt;ul id=\"authors\"&gt;&lt;\/ul&gt;\r\n&lt;script&gt;\r\nconst ul = document.getElementById('authors');\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u0628\u0647 \u06cc\u0627\u062f \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f\u060c \u0646\u0648\u06cc\u0633\u0646\u062f\u0647 \u0647\u0627 \u0634\u0646\u0627\u0633\u0647 ul \u0642\u0628\u0644\u06cc \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647 \u0627\u0633\u062a.<\/p>\n<p>\u0633\u067e\u0633 \u06cc\u06a9 \u0644\u06cc\u0633\u062a \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u06cc\u06a9 DocumentFragment \u0627\u0633\u062a:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nconst list = document.createDocumentFragment();\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u062a\u0645\u0627\u0645 \u0645\u0648\u0627\u0631\u062f \u0644\u06cc\u0633\u062a \u0636\u0645\u06cc\u0645\u0647 \u0634\u062f\u0647 \u0628\u0647 \u0644\u06cc\u0633\u062a \u0627\u0636\u0627\u0641\u0647 \u062e\u0648\u0627\u0647\u0646\u062f \u0634\u062f. \u06cc\u06a9 DocumentFragment \u0628\u062e\u0634\u06cc \u0627\u0632 \u0633\u0627\u062e\u062a\u0627\u0631 \u062f\u0631\u062e\u062a \u0633\u0646\u062f \u0641\u0639\u0627\u0644 \u0646\u06cc\u0633\u062a. \u0627\u06cc\u0646 \u0645\u0632\u06cc\u062a \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u0647\u0646\u06af\u0627\u0645 \u062a\u063a\u06cc\u06cc\u0631 \u0645\u062f\u0644 \u0634\u06cc\u0621 \u0633\u0646\u062f\u060c \u062a\u0631\u0633\u06cc\u0645 \u0645\u062c\u062f\u062f \u0627\u062b\u0631\u06af\u0630\u0627\u0631 \u0628\u0631 \u0639\u0645\u0644\u06a9\u0631\u062f \u0627\u06cc\u062c\u0627\u062f \u0646\u0645\u06cc \u06a9\u0646\u062f.<\/p>\n<p>\u06cc\u06a9 \u0645\u062a\u063a\u06cc\u0631 \u062b\u0627\u0628\u062a \u0628\u0647 \u0646\u0627\u0645 url \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 URL API \u0631\u0627 \u0646\u06af\u0647 \u0645\u06cc \u062f\u0627\u0631\u062f \u06a9\u0647 \u062f\u0647 \u06a9\u0627\u0631\u0628\u0631 \u062a\u0635\u0627\u062f\u0641\u06cc \u0631\u0627 \u0628\u0631\u0645\u06cc \u06af\u0631\u062f\u0627\u0646\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nconst url = 'https:\/\/jsonplaceholder.typicode.com\/users';\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u0627\u06a9\u0646\u0648\u0646 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Fetch API\u060c API JSONPlaceholder \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 fetch() \u0628\u0627 url \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0622\u0631\u06af\u0648\u0645\u0627\u0646 \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nfetch(url)\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u0634\u0645\u0627 \u062f\u0631 \u062d\u0627\u0644 \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc Fetch API \u0647\u0633\u062a\u06cc\u062f \u0648 URL \u0631\u0627 \u0628\u0647 JSONPlaceholder API \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc \u06a9\u0646\u06cc\u062f. \u0633\u067e\u0633 \u067e\u0627\u0633\u062e \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc \u0634\u0648\u062f. \u0628\u0627 \u0627\u06cc\u0646 \u062d\u0627\u0644\u060c \u067e\u0627\u0633\u062e\u06cc \u06a9\u0647 \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f JSON \u0646\u06cc\u0633\u062a\u060c \u0628\u0644\u06a9\u0647 \u06cc\u06a9 \u0634\u06cc \u0628\u0627 \u06cc\u06a9 \u0633\u0631\u06cc \u0631\u0648\u0634\u200c\u0647\u0627 \u0627\u0633\u062a \u06a9\u0647 \u0628\u0633\u062a\u0647 \u0628\u0647 \u06a9\u0627\u0631\u06cc \u06a9\u0647 \u0645\u06cc\u200c\u062e\u0648\u0627\u0647\u06cc\u062f \u0628\u0627 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0627\u0632 \u0622\u0646\u0647\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f. \u0628\u0631\u0627\u06cc \u062a\u0628\u062f\u06cc\u0644 \u0634\u06cc \u0628\u0631\u06af\u0634\u062a\u06cc \u0628\u0647 JSON \u0627\u0632 \u0645\u062a\u062f json() \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p>\u0645\u062a\u062f then() \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u062d\u0627\u0648\u06cc \u062a\u0627\u0628\u0639\u06cc \u0628\u0627 \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u06cc \u0628\u0647 \u0646\u0627\u0645 \u067e\u0627\u0633\u062e \u0627\u0633\u062a:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nfetch(url)\r\n.then((response) =&gt; {})\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u067e\u0627\u0633\u062e\u060c \u0645\u0642\u062f\u0627\u0631 \u0634\u06cc \u0631\u0627 \u06a9\u0647 \u0627\u0632 fetch(url) \u0628\u0631\u06af\u0631\u062f\u0627\u0646\u062f\u0647 \u0645\u06cc \u0634\u0648\u062f\u060c \u0645\u06cc \u06af\u06cc\u0631\u062f. \u0627\u0632 \u0645\u062a\u062f json() \u0628\u0631\u0627\u06cc \u062a\u0628\u062f\u06cc\u0644 \u067e\u0627\u0633\u062e \u0628\u0647 \u062f\u0627\u062f\u0647 JSON \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nfetch(url)\r\n.then((response) =&gt; {\r\nreturn response.json();\r\n})\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u062f\u0627\u062f\u0647\u200c\u0647\u0627\u06cc JSON \u0647\u0646\u0648\u0632 \u0628\u0627\u06cc\u062f \u067e\u0631\u062f\u0627\u0632\u0634 \u0634\u0648\u0646\u062f. \u06cc\u06a9 \u0639\u0628\u0627\u0631\u062a then() \u062f\u06cc\u06af\u0631 \u0628\u0627 \u062a\u0627\u0628\u0639\u06cc \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0622\u0631\u06af\u0648\u0645\u0627\u0646\u06cc \u0628\u0647 \u0646\u0627\u0645 \u062f\u0627\u062f\u0647 \u062f\u0627\u0631\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nfetch(url)\r\n.then((response) =&gt; {\r\nreturn response.json();\r\n})\r\n.then((data) =&gt; {})\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u062a\u0627\u0628\u0639\u060c \u06cc\u06a9 \u0645\u062a\u063a\u06cc\u0631 \u0628\u0647 \u0646\u0627\u0645 \u0646\u0648\u06cc\u0633\u0646\u062f\u0647 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0628\u0631\u0627\u0628\u0631 \u0628\u0627 \u062f\u0627\u062f\u0647 \u062a\u0646\u0638\u06cc\u0645 \u0634\u062f\u0647 \u0627\u0633\u062a:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nfetch(url)\r\n.then((response) =&gt; {\r\nreturn response.json();\r\n})\r\n.then((data) =&gt; {\r\nlet authors = data;\r\n})\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u0628\u0631\u0627\u06cc \u0647\u0631 \u0646\u0648\u06cc\u0633\u0646\u062f\u0647 \u062f\u0631 \u0646\u0648\u06cc\u0633\u0646\u062f\u06af\u0627\u0646\u060c \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u062f \u06cc\u06a9 \u0622\u06cc\u062a\u0645 \u0641\u0647\u0631\u0633\u062a \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0646\u0627\u0645 \u0622\u0646\u0647\u0627 \u0631\u0627 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0647\u062f. \u0645\u062a\u062f map() \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0627\u0644\u06af\u0648 \u0645\u0646\u0627\u0633\u0628 \u0627\u0633\u062a:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nfetch(url)\r\n.then((response) =&gt; {\r\nreturn response.json();\r\n})\r\n.then((data) =&gt; {\r\nlet authors = data;\r\nauthors.map(function(author) {\r\n});\r\n})\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u062f\u0631 \u062a\u0627\u0628\u0639 \u0646\u0642\u0634\u0647 \u062e\u0648\u062f\u060c \u0645\u062a\u063a\u06cc\u0631\u06cc \u0628\u0647 \u0646\u0627\u0645 li \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0628\u0631\u0627\u0628\u0631 \u0628\u0627 createElement \u0628\u0627 li (\u0639\u0646\u0635\u0631 HTML) \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0622\u0631\u06af\u0648\u0645\u0627\u0646 \u062a\u0646\u0638\u06cc\u0645 \u0634\u0648\u062f. \u0647\u0645\u0686\u0646\u06cc\u0646 \u06cc\u06a9 h2 \u0628\u0631\u0627\u06cc \u0646\u0627\u0645 \u0648 \u06cc\u06a9 span \u0628\u0631\u0627\u06cc \u0627\u06cc\u0645\u06cc\u0644 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nfetch(url)\r\n.then((response) =&gt; {\r\nreturn response.json();\r\n})\r\n.then((data) =&gt; {\r\nlet authors = data;\r\nauthors.map(function(author) {\r\nlet li = document.createElement('li');\r\nlet name = document.createElement('h2');\r\nlet email = document.createElement('span');\r\n});\r\n})\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u0639\u0646\u0635\u0631 h2 \u062d\u0627\u0648\u06cc \u0646\u0627\u0645 \u0646\u0648\u06cc\u0633\u0646\u062f\u0647 \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f. \u0639\u0646\u0635\u0631 span \u062d\u0627\u0648\u06cc \u0627\u06cc\u0645\u06cc\u0644 \u0646\u0648\u06cc\u0633\u0646\u062f\u0647 \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f. \u0648\u06cc\u0698\u06af\u06cc innerHTML \u0648 \u062f\u0631\u0648\u0646 \u06cc\u0627\u0628\u06cc \u0631\u0634\u062a\u0647 \u0627\u06cc \u0628\u0647 \u0634\u0645\u0627 \u0627\u06cc\u0646 \u0627\u0645\u06a9\u0627\u0646 \u0631\u0627 \u0645\u06cc \u062f\u0647\u062f \u06a9\u0647 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nfetch(url)\r\n.then((response) =&gt; {\r\nreturn response.json();\r\n})\r\n.then((data) =&gt; {\r\nlet authors = data;\r\nauthors.map(function(author) {\r\nlet li = document.createElement('li');\r\nlet name = document.createElement('h2');\r\nlet email = document.createElement('span');\r\nname.innerHTML = `${author.name}`;\r\nemail.innerHTML = `${author.email}`;\r\n});\r\n})\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u0633\u067e\u0633\u060c \u0627\u06cc\u0646 \u0639\u0646\u0627\u0635\u0631 DOM \u0631\u0627 \u0628\u0627 appendChild \u0648\u0635\u0644 \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nfetch(url)\r\n.then((response) =&gt; {\r\nreturn response.json();\r\n})\r\n.then((data) =&gt; {\r\nlet authors = data;\r\nauthors.map(function(author) {\r\nlet li = document.createElement('li');\r\nlet name = document.createElement('h2');\r\nlet email = document.createElement('span');\r\nname.innerHTML = `${author.name}`;\r\nemail.innerHTML = `${author.email}`;\r\nli.appendChild(name);\r\nli.appendChild(email);\r\nlist.appendChild(li);\r\n});\r\n})\r\nul.appendChild(list);\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u062a\u0648\u062c\u0647 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 \u0647\u0631 \u0645\u0648\u0631\u062f \u0644\u06cc\u0633\u062a \u0628\u0647 \u0644\u06cc\u0633\u062a DocumentFragment \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc \u0634\u0648\u062f. \u067e\u0633 \u0627\u0632 \u062a\u06a9\u0645\u06cc\u0644 \u0646\u0642\u0634\u0647\u060c \u0644\u06cc\u0633\u062a \u0628\u0647 \u0639\u0646\u0635\u0631 \u0644\u06cc\u0633\u062a \u0646\u0627\u0645\u0631\u062a\u0628 ul \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc \u0634\u0648\u062f.<\/p>\n<p>\u0628\u0627 \u062a\u06a9\u0645\u06cc\u0644 \u0647\u0631 \u062f\u0648 \u062a\u0627\u0628\u0639 then() \u0627\u06a9\u0646\u0648\u0646 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u062a\u0627\u0628\u0639 catch() \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f. \u0627\u06cc\u0646 \u062a\u0627\u0628\u0639 \u062e\u0637\u0627\u06cc \u0627\u062d\u062a\u0645\u0627\u0644\u06cc \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u062b\u0628\u062a \u0645\u06cc \u06a9\u0646\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;script&gt;\r\n\/\/ ...\r\nfetch(url)\r\n.then((response) =&gt; {\r\n\/\/ ...\r\n})\r\n.then((data) =&gt; {\r\n\/\/ ...\r\n})\r\n.catch(function(error) {\r\nconsole.log(error);\r\n});\r\n\/\/ ...\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u0627\u06cc\u0646 \u06a9\u062f \u06a9\u0627\u0645\u0644 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0631\u062f\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;h1&gt;Authors&lt;\/h1&gt;\r\n&lt;ul id=\"authors\"&gt;&lt;\/ul&gt;\r\n&lt;script&gt;\r\nconst ul = document.getElementById('authors');\r\nconst list = document.createDocumentFragment();\r\nconst url = 'https:\/\/jsonplaceholder.typicode.com\/users';\r\nfetch(url)\r\n.then((response) =&gt; {\r\nreturn response.json();\r\n})\r\n.then((data) =&gt; {\r\nlet authors = data;\r\nauthors.map(function(author) {\r\nlet li = document.createElement('li');\r\nlet name = document.createElement('h2');\r\nlet email = document.createElement('span');\r\nname.innerHTML = `${author.name}`;\r\nemail.innerHTML = `${author.email}`;\r\nli.appendChild(name);\r\nli.appendChild(email);\r\nlist.appendChild(li);\r\n});\r\n}).\r\n.catch(function(error) {\r\nconsole.log(error);\r\n});\r\nul.appendChild(list);\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>\u0634\u0645\u0627 \u0628\u0647 \u062a\u0627\u0632\u06af\u06cc \u06cc\u06a9 \u062f\u0631\u062e\u0648\u0627\u0633\u062a GET \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JSONPlaceholder API \u0648 Fetch API \u0628\u0627 \u0645\u0648\u0641\u0642\u06cc\u062a \u0627\u0646\u062c\u0627\u0645 \u062f\u0627\u062f\u06cc\u062f. \u062f\u0631 \u0645\u0631\u062d\u0644\u0647 \u0628\u0639\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc POST \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u062e\u0648\u0627\u0647\u06cc\u062f \u062f\u0627\u062f.<\/p>\n<h2 id=\"%d9%85%d8%b1%d8%ad%d9%84%d9%87-3-%d8%b1%d8%b3%db%8c%d8%af%da%af%db%8c-%d8%a8%d9%87-%d8%af%d8%b1%d8%ae%d9%88%d8%a7%d8%b3%d8%aa-%d9%87%d8%a7%db%8c-post\">\u0645\u0631\u062d\u0644\u0647 3 &#8211; \u0631\u0633\u06cc\u062f\u06af\u06cc \u0628\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc POST<\/h2>\n<p>\u067e\u06cc\u0634\u200c\u0641\u0631\u0636\u200c\u0647\u0627 \u0631\u0627 \u0628\u0631\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc GET \u0648\u0627\u06a9\u0634\u06cc \u06a9\u0646\u06cc\u062f\u060c \u0627\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0647\u0645\u0647 \u0627\u0646\u0648\u0627\u0639 \u062f\u06cc\u06af\u0631 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f\u060c \u0647\u062f\u0631\u0647\u0627 \u0631\u0627 \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0647\u06cc\u062f \u0648 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0631\u0627 \u0627\u0631\u0633\u0627\u0644 \u06a9\u0646\u06cc\u062f. \u0628\u06cc\u0627\u06cc\u06cc\u062f \u06cc\u06a9 \u062f\u0631\u062e\u0648\u0627\u0633\u062a POST \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u0645.<\/p>\n<p>\u0627\u0628\u062a\u062f\u0627\u060c \u06cc\u06a9 \u0645\u062a\u063a\u06cc\u0631 \u062b\u0627\u0628\u062a \u0628\u06af\u0646\u062c\u0627\u0646\u06cc\u062f \u06a9\u0647 \u067e\u06cc\u0648\u0646\u062f \u0628\u0647 JSONPlaceholder API \u0631\u0627 \u0646\u06af\u0647 \u0645\u06cc \u062f\u0627\u0631\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>const url = 'https:\/\/jsonplaceholder.typicode.com\/users';\r\n<\/code><\/pre>\n<\/div>\n<p>\u062f\u0631 \u0645\u0631\u062d\u0644\u0647 \u0628\u0639\u062f\u060c \u0628\u0627\u06cc\u062f \u0634\u06cc \u062e\u0648\u062f \u0631\u0627 \u062a\u0646\u0638\u06cc\u0645 \u06a9\u0646\u06cc\u062f \u0648 \u0622\u0646 \u0631\u0627 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0622\u0631\u06af\u0648\u0645\u0627\u0646 \u062f\u0648\u0645 \u062a\u0627\u0628\u0639 fetch \u0627\u0631\u0633\u0627\u0644 \u06a9\u0646\u06cc\u062f. \u0627\u06cc\u0646 \u06cc\u06a9 \u0634\u06cc \u0628\u0647 \u0646\u0627\u0645 \u062f\u0627\u062f\u0647 \u0628\u0627 \u0646\u0627\u0645 \u06a9\u0644\u06cc\u062f \u0648 \u0645\u0642\u062f\u0627\u0631 Sammy (\u06cc\u0627 \u0646\u0627\u0645 \u0634\u0645\u0627) \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\/\/ ...\r\nlet data = {\r\nname: 'Sammy'\r\n}<\/code><\/pre>\n<\/div>\n<p>\u0627\u0632 \u0622\u0646\u062c\u0627\u06cc\u06cc \u06a9\u0647 \u0627\u06cc\u0646 \u06cc\u06a9 \u062f\u0631\u062e\u0648\u0627\u0633\u062a POST \u0627\u0633\u062a\u060c \u0628\u0627\u06cc\u062f \u0622\u0646 \u0631\u0627 \u0628\u0647 \u0635\u0631\u0627\u062d\u062a \u0628\u06cc\u0627\u0646 \u06a9\u0646\u06cc\u062f. \u06cc\u06a9 \u0634\u06cc \u0628\u0647 \u0646\u0627\u0645 fetchData \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\/\/ ...\r\nlet fetchData = {\r\n}<\/code><\/pre>\n<\/div>\n<p>\u0627\u06cc\u0646 \u0634\u06cc \u0628\u0627\u06cc\u062f \u0634\u0627\u0645\u0644 \u0633\u0647 \u06a9\u0644\u06cc\u062f \u0645\u062a\u062f\u060c \u0628\u062f\u0646\u0647 \u0648 \u0647\u062f\u0631 \u0628\u0627\u0634\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\/\/ ...\r\nlet fetchData = {\r\nmethod: 'POST',\r\nbody: JSON.stringify(data),\r\nheaders: new Headers({\r\n'Content-Type': 'application\/json; charset=UTF-8'\r\n})\r\n}<\/code><\/pre>\n<\/div>\n<p>\u06a9\u0644\u06cc\u062f \u0645\u062a\u062f \u0645\u0642\u062f\u0627\u0631 &#8220;POST&#8221; \u0631\u0627 \u062e\u0648\u0627\u0647\u062f \u062f\u0627\u0634\u062a. body \u0628\u0631\u0627\u0628\u0631 \u0628\u0627 \u0641\u0631\u0645\u062a JSON.stringify \u0634\u06cc \u062f\u0627\u062f\u0647 \u0627\u06cc \u06a9\u0647 \u0628\u0647 \u062a\u0627\u0632\u06af\u06cc \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647 \u0627\u0633\u062a \u062a\u0646\u0638\u06cc\u0645 \u0645\u06cc \u0634\u0648\u062f. \u0647\u062f\u0631\u0647\u0627 \u0645\u0642\u062f\u0627\u0631 \u00abContent-Type\u00bb \u0631\u0627 \u062e\u0648\u0627\u0647\u0646\u062f \u062f\u0627\u0634\u062a: \u00abapplication\/json; charset=UTF-8&#8242;.<\/p>\n<p>\u0631\u0627\u0628\u0637 Headers \u06cc\u06a9\u06cc \u0627\u0632 \u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc Fetch API \u0627\u0633\u062a \u06a9\u0647 \u0628\u0647 \u0634\u0645\u0627 \u0627\u062c\u0627\u0632\u0647 \u0645\u06cc \u062f\u0647\u062f \u062a\u0627 \u0627\u0642\u062f\u0627\u0645\u0627\u062a\u06cc \u0631\u0627 \u0631\u0648\u06cc \u0647\u062f\u0631\u0647\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0648 \u067e\u0627\u0633\u062e HTTP \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f.<\/p>\n<p>\u0628\u0627 \u0642\u0631\u0627\u0631 \u062f\u0627\u062f\u0646 \u0627\u06cc\u0646 \u06a9\u062f\u060c \u062f\u0631\u062e\u0648\u0627\u0633\u062a POST \u0631\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Fetch API \u0627\u0646\u062c\u0627\u0645 \u062f\u0627\u062f. \u0634\u0645\u0627 url \u0648 fetchData \u0648 \u0622\u0631\u06af\u0648\u0645\u0627\u0646 \u0647\u0627\u06cc\u06cc \u0631\u0627 \u0628\u0631\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a fetch POST \u062e\u0648\u062f \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\/\/ ...\r\nfetch(url, fetchData)<\/code><\/pre>\n<\/div>\n<p>\u062a\u0627\u0628\u0639 then() \u0634\u0627\u0645\u0644 \u06a9\u062f\u06cc \u0627\u0633\u062a \u06a9\u0647 \u067e\u0627\u0633\u062e \u062f\u0631\u06cc\u0627\u0641\u062a\u06cc \u0627\u0632 JSONPlaceholder API \u0631\u0627 \u0645\u062f\u06cc\u0631\u06cc\u062a \u0645\u06cc \u06a9\u0646\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\/\/ ...\r\nfetch(url, fetchData)\r\n.then(function() {\r\n\/\/ Handle response you get from the API\r\n});<\/code><\/pre>\n<\/div>\n<p>\u0627\u06cc\u0646 \u06a9\u062f \u06a9\u0627\u0645\u0644 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0631\u062f\u06cc\u062f:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>const url = 'https:\/\/jsonplaceholder.typicode.com\/users';\r\nlet data = {\r\nname: 'Sammy'\r\n}\r\nlet fetchData = {\r\nmethod: 'POST',\r\nbody: JSON.stringify(data),\r\nheaders: new Headers({\r\n'Content-Type': 'application\/json; charset=UTF-8'\r\n})\r\n}\r\nfetch(url, fetchData)\r\n.then(function() {\r\n\/\/ Handle response you get from the API\r\n});<\/code><\/pre>\n<\/div>\n<p>\u0647\u0645\u0686\u0646\u06cc\u0646 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f fetch() \u0631\u0627 \u0628\u0647 \u06cc\u06a9 \u0634\u06cc Request \u0627\u0631\u0633\u0627\u0644 \u06a9\u0646\u06cc\u062f.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>const url = 'https:\/\/jsonplaceholder.typicode.com\/users';\r\nlet data = {\r\nname: 'Sammy'\r\n}\r\nlet request = new Request(url, {\r\nmethod: 'POST',\r\nbody: JSON.stringify(data),\r\nheaders: new Headers({\r\n'Content-Type': 'application\/json; charset=UTF-8'\r\n})\r\n});\r\nfetch(request)\r\n.then(function() {\r\n\/\/ Handle response you get from the API\r\n});<\/code><\/pre>\n<\/div>\n<p>\u0628\u0627 \u0627\u06cc\u0646 \u0631\u0648\u06cc\u06a9\u0631\u062f\u060c \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u062a\u0646\u0647\u0627 \u0622\u0631\u06af\u0648\u0645\u0627\u0646 \u0628\u0631\u0627\u06cc fetch()\u060c \u062c\u0627\u06cc\u06af\u0632\u06cc\u0646 url \u0648 fetchData \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0634\u0648\u062f.<\/p>\n<p>\u0627\u06a9\u0646\u0648\u0646 \u062f\u0648 \u0631\u0648\u0634 \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u0648 \u0627\u062c\u0631\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc POST \u0628\u0627 Fetch API \u0645\u06cc \u0634\u0646\u0627\u0633\u06cc\u062f.<\/p>\n<h2 id=\"%d9%86%d8%aa%db%8c%d8%ac%d9%87\">\u0646\u062a\u06cc\u062c\u0647<\/h2>\n<p>\u062f\u0631 \u062d\u0627\u0644\u06cc \u06a9\u0647 Fetch API \u0647\u0646\u0648\u0632 \u062a\u0648\u0633\u0637 \u0647\u0645\u0647 \u0645\u0631\u0648\u0631\u06af\u0631\u0647\u0627 \u067e\u0634\u062a\u06cc\u0628\u0627\u0646\u06cc \u0646\u0645\u06cc \u0634\u0648\u062f\u060c \u062c\u0627\u06cc\u06af\u0632\u06cc\u0646\u06cc \u0639\u0627\u0644\u06cc \u0628\u0631\u0627\u06cc XMLHttpRequest \u0627\u0633\u062a.<\/p>\n","protected":false},"excerpt":{"rendered":"\u0645\u0642\u062f\u0645\u0647 \u0632\u0645\u0627\u0646\u06cc \u0628\u0648\u062f \u06a9\u0647 \u0627\u0632 XMLHttpRequest \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc API \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u0634\u062f. \u0634\u0627\u0645\u0644 Promises \u0646\u0628\u0648\u062f \u0648&hellip;\n","protected":false},"author":1,"featured_media":16676,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Fetch API","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_canonical":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_opengraph-image":"","_yoast_wpseo_twitter-description":"","_yoast_wpseo_twitter-image":"","_yoast_wpseo_focuskeywords":"[]","_yoast_wpseo_primary_category":"193","footnotes":""},"categories":[193,363],"tags":[384,435],"class_list":{"0":"post-16673","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tutorials","8":"category-programming","9":"tag-java-script","10":"tag-programming"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647 - \u0628\u0644\u0627\u06af ITPiran<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/\" \/>\n<meta property=\"og:locale\" content=\"fa_IR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647 - \u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"og:description\" content=\"\u0645\u0642\u062f\u0645\u0647 \u0632\u0645\u0627\u0646\u06cc \u0628\u0648\u062f \u06a9\u0647 \u0627\u0632 XMLHttpRequest \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc API \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u0634\u062f. \u0634\u0627\u0645\u0644 Promises \u0646\u0628\u0648\u062f \u0648&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-22T08:01:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.itpiran.net\/2025\/01\/22113024\/FetchApi.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1793\" \/>\n\t<meta property=\"og:image:height\" content=\"1110\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u0646\u0648\u0634\u062a\u0647\u200c\u0634\u062f\u0647 \u0628\u062f\u0633\u062a\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u0632\u0645\u0627\u0646 \u062a\u0642\u0631\u06cc\u0628\u06cc \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u062f\u0646\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 \u062f\u0642\u06cc\u0642\u0647\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\"},\"headline\":\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647\",\"datePublished\":\"2025-01-22T08:01:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/\"},\"wordCount\":154,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2025\\\/01\\\/22113024\\\/FetchApi.jpg\",\"keywords\":[\"Java Script\",\"programming\"],\"articleSection\":[\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc\"],\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/\",\"name\":\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647 - \u0628\u0644\u0627\u06af ITPiran\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2025\\\/01\\\/22113024\\\/FetchApi.jpg\",\"datePublished\":\"2025-01-22T08:01:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/#breadcrumb\"},\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fa-IR\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2025\\\/01\\\/22113024\\\/FetchApi.jpg\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2025\\\/01\\\/22113024\\\/FetchApi.jpg\",\"width\":1793,\"height\":1110},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-the-javascript-fetch-api-to-get-data\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/category\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"name\":\"\u0628\u0644\u0627\u06af ITPiran\",\"description\":\"\u0627\u062e\u0628\u0627\u0631 \u0648 \u0645\u0642\u0627\u0644\u0627\u062a \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fa-IR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\",\"name\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"alternateName\":\"ITPIran Blog\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fa-IR\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"width\":512,\"height\":512,\"caption\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\",\"name\":\"admin\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647 - \u0628\u0644\u0627\u06af ITPiran","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/","og_locale":"fa_IR","og_type":"article","og_title":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647 - \u0628\u0644\u0627\u06af ITPiran","og_description":"\u0645\u0642\u062f\u0645\u0647 \u0632\u0645\u0627\u0646\u06cc \u0628\u0648\u062f \u06a9\u0647 \u0627\u0632 XMLHttpRequest \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc API \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u0634\u062f. \u0634\u0627\u0645\u0644 Promises \u0646\u0628\u0648\u062f \u0648&hellip;","og_url":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/","og_site_name":"\u0628\u0644\u0627\u06af ITPiran","article_published_time":"2025-01-22T08:01:39+00:00","og_image":[{"width":1793,"height":1110,"url":"https:\/\/cdn.itpiran.net\/2025\/01\/22113024\/FetchApi.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u0646\u0648\u0634\u062a\u0647\u200c\u0634\u062f\u0647 \u0628\u062f\u0633\u062a":"admin","\u0632\u0645\u0627\u0646 \u062a\u0642\u0631\u06cc\u0628\u06cc \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u062f\u0646":"9 \u062f\u0642\u06cc\u0642\u0647"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/#article","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/"},"author":{"name":"admin","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81"},"headline":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647","datePublished":"2025-01-22T08:01:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/"},"wordCount":154,"commentCount":0,"publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2025\/01\/22113024\/FetchApi.jpg","keywords":["Java Script","programming"],"articleSection":["\u0622\u0645\u0648\u0632\u0634\u06cc","\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc"],"inLanguage":"fa-IR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/","url":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/","name":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647 - \u0628\u0644\u0627\u06af ITPiran","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/#primaryimage"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2025\/01\/22113024\/FetchApi.jpg","datePublished":"2025-01-22T08:01:39+00:00","breadcrumb":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/#breadcrumb"},"inLanguage":"fa-IR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/"]}]},{"@type":"ImageObject","inLanguage":"fa-IR","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/#primaryimage","url":"https:\/\/cdn.itpiran.net\/2025\/01\/22113024\/FetchApi.jpg","contentUrl":"https:\/\/cdn.itpiran.net\/2025\/01\/22113024\/FetchApi.jpg","width":1793,"height":1110},{"@type":"BreadcrumbList","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-the-javascript-fetch-api-to-get-data\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.itpiran.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u0622\u0645\u0648\u0632\u0634\u06cc","item":"https:\/\/www.itpiran.net\/blog\/category\/tutorials\/"},{"@type":"ListItem","position":3,"name":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JavaScript Fetch API \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647"}]},{"@type":"WebSite","@id":"https:\/\/www.itpiran.net\/blog\/#website","url":"https:\/\/www.itpiran.net\/blog\/","name":"\u0628\u0644\u0627\u06af ITPiran","description":"\u0627\u062e\u0628\u0627\u0631 \u0648 \u0645\u0642\u0627\u0644\u0627\u062a \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646","publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.itpiran.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fa-IR"},{"@type":"Organization","@id":"https:\/\/www.itpiran.net\/blog\/#organization","name":"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646","alternateName":"ITPIran Blog","url":"https:\/\/www.itpiran.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"fa-IR","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","contentUrl":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","width":512,"height":512,"caption":"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81","name":"admin","url":"https:\/\/www.itpiran.net\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/posts\/16673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/comments?post=16673"}],"version-history":[{"count":1,"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/posts\/16673\/revisions"}],"predecessor-version":[{"id":16675,"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/posts\/16673\/revisions\/16675"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/media\/16676"}],"wp:attachment":[{"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/media?parent=16673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/categories?post=16673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/wp-json\/wp\/v2\/tags?post=16673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}