{"id":13005,"date":"2020-11-24T12:37:34","date_gmt":"2020-11-24T09:07:34","guid":{"rendered":"https:\/\/maktabkhooneh.org\/mag\/?p=13005"},"modified":"2026-04-06T21:24:37","modified_gmt":"2026-04-06T17:54:37","slug":"create-http-requests-in-javascript","status":"publish","type":"post","link":"https:\/\/maktabkhooneh.org\/mag\/create-http-requests-in-javascript\/","title":{"rendered":"\u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0645\u0648\u0631\u062f \u062a\u0648\u0633\u0639\u0647 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc \u0645\u062f\u0631\u0646\u060c \u0627\u0639\u0645 \u0627\u0632 \u0648\u0628\u060c \u0645\u0648\u0628\u0627\u06cc\u0644 \u06cc\u0627 \u0633\u0627\u06cc\u0631 \u0645\u0648\u0627\u0631\u062f\u060c \u062a\u0642\u0631\u06cc\u0628\u0627\u064b \u0647\u0645\u06cc\u0634\u0647 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u062a\u0639\u0627\u0645\u0644 \u0628\u0627 \u0633\u0631\u0648\u06cc\u0633\u200c\u0647\u0627\u06cc \u0648\u0628 \u0627\u0632 \u0631\u0627\u0647 \u062f\u0648\u0631\u060c \u0645\u0639\u0645\u0648\u0644\u0627\u064b \u0627\u0632 \u0637\u0631\u06cc\u0642 HTTP \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f. \u0647\u0646\u06af\u0627\u0645 \u06a9\u0627\u0631 \u0628\u0627 \u0686\u0627\u0631\u0686\u0648\u0628\u200c\u0647\u0627\u06cc\u06cc \u0645\u0627\u0646\u0646\u062f Angular \u060c Vue \u0648 React \u060c \u0639\u0645\u0644\u06a9\u0631\u062f\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u0628\u0631\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f\u060c \u0627\u0645\u0627 \u0627\u06af\u0631 \u0627\u0632 JavaScript \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f \u06cc\u0627 \u062a\u0631\u062c\u06cc\u062d \u0645\u06cc\u200c\u062f\u0647\u06cc\u062f \u0627\u0632 \u0645\u0648\u0627\u0631\u062f \u0633\u0627\u062e\u062a\u0647 \u0634\u062f\u0647 \u0648 \u0622\u0645\u062f\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0646\u06a9\u0646\u06cc\u062f\u060c \u0686\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f\u061f \u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634 \u0645\u06cc\u200c\u062e\u0648\u0627\u0647\u06cc\u0645 \u0686\u0646\u062f \u06af\u0632\u06cc\u0646\u0647 \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c HTTP \u062f\u0631 JavaScript \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u0645. \u0628\u0647 \u0637\u0648\u0631 \u062e\u0627\u0635 \u0645\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0648\u0627\u06a9\u0634\u06cc \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a (javascript) \u0645\u062f\u0631\u0646 \u0648 \u0647\u0645\u0686\u0646\u06cc\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06cc\u06a9 \u0628\u0633\u062a\u0647 \u0634\u062e\u0635 \u062b\u0627\u0644\u062b \u0628\u0647 \u0646\u0627\u0645 Axios\u060c \u0628\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0644\u0627\u0633\u06cc\u06a9 XHR \u0648 <a href=\"https:\/\/maktabkhooneh.org\/mag\/create-http-requests-in-javascript\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>\u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a<\/strong><\/a> \u062e\u0648\u0627\u0647\u06cc\u0645 \u067e\u0631\u062f\u0627\u062e\u062a.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full wp-image-13010\"><img fetchpriority=\"high\" decoding=\"async\" width=\"853\" height=\"359\" src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2020\/11\/\u062f\u0631\u062e\u0648\u0627\u0633\u062a-HTTP-\u062f\u0631-\u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a.png\" alt=\"\u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u062f\u0631 \u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\" class=\"wp-image-13010\" title=\"\" srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2020\/11\/\u062f\u0631\u062e\u0648\u0627\u0633\u062a-HTTP-\u062f\u0631-\u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a.png 853w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2020\/11\/\u062f\u0631\u062e\u0648\u0627\u0633\u062a-HTTP-\u062f\u0631-\u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a-300x126.png.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2020\/11\/\u062f\u0631\u062e\u0648\u0627\u0633\u062a-HTTP-\u062f\u0631-\u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a-768x323.png.webp 768w\" sizes=\"(max-width: 853px) 100vw, 853px\" \/><figcaption class=\"wp-element-caption\"><span style=\"font-size: 16px;\">\u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a<\/span><\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0646\u062d\u0648\u0647 \u0627\u0646\u062a\u062e\u0627\u0628 \u0631\u0648\u0634 \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0647\u0646\u06af\u0627\u0645 \u062a\u0635\u0645\u06cc\u0645\u200c\u06af\u06cc\u0631\u06cc \u062f\u0631 \u0645\u0648\u0631\u062f \u0686\u06af\u0648\u0646\u06af\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc HTTP \u062f\u0631 JavaScript\u060c \u0628\u0647 \u0639\u0645\u0644\u06a9\u0631\u062f \u0622\u0646 \u0628\u0627\u06cc\u062f \u062f\u0642\u062a \u06a9\u0646\u06cc\u0645 \u0648 \u0628\u0631 \u0627\u0633\u0627\u0633 \u0639\u0645\u0644\u06a9\u0631\u062f \u0645\u0648\u0631\u062f\u0646\u0638\u0631 \u062a\u0635\u0645\u06cc\u0645 \u0628\u0647 \u0627\u0646\u062a\u062e\u0627\u0628 \u06cc\u06a9\u06cc \u0627\u0632 \u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u0628\u067e\u0631\u062f\u0627\u0632\u06cc\u0645. \u0647\u0631\u06a9\u062f\u0627\u0645 \u0627\u0632 \u0645\u0648\u0627\u0631\u062f\u06cc \u06a9\u0647 \u0630\u06a9\u0631 \u0645\u06cc\u200c\u0634\u0648\u062f \u0646\u0642\u0627\u0637 \u0642\u0648\u062a \u062e\u0648\u062f \u0631\u0627 \u062f\u0627\u0631\u0646\u062f \u0648 \u0627\u0632 \u0637\u0631\u0641\u06cc \u062f\u0627\u0631\u0627\u06cc \u0636\u0639\u0641\u200c\u0647\u0627\u06cc\u06cc \u0647\u0645 \u0647\u0633\u062a\u0646\u062f.<\/span><\/p>\n\n\n<div class=\"jet-listing-grid--50121\" style=\"\"><div class=\"jet-listing-dynamic-field-block zht-maktab-khooneh-course cb-fb2qc30r\"data-is-block=\"jet-engine\/dynamic-field\"><div class=\"jet-listing-dynamic-field__content\" >\n<div class=\"course-card\">\n    <div class=\"course-card-img\">\n        <img decoding=\"async\" \n            data-src=\"https:\/\/media1.maktabkhooneh.org\/CACHE\/images\/courses\/images\/irani-java1469262849_1403-08-16-165118451\/564e0570caf81c8ed249c9411191f16c.webp?expire=4893471932&#038;token=fc365994d206f68f8b7288fb018a03f3&#038;md5=_DZZlNIG9o-Lcoj7AYoD8w==\" \n            alt=\"\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u067e\u06cc\u0634\u0631\u0641\u062a\u0647 (\u062c\u0627\u0648\u0627)\" \n            title=\"\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u067e\u06cc\u0634\u0631\u0641\u062a\u0647 (\u062c\u0627\u0648\u0627)\" \n            width=\"100%\" \n            height=\"auto\"\n           \n         src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\">\n    <\/div>\n\n    <div class=\"course-details\">\n        <a href=\"https:\/\/maktabkhooneh.org\/course\/%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87-%D9%86%D9%88%DB%8C%D8%B3%DB%8C-%D9%BE%DB%8C%D8%B4%D8%B1%D9%81%D8%AA%D9%87-%D8%AC%D8%A7%D9%88%D8%A7-mk242\/\" class=\"course-title\" target=\"_blank\" rel=\"noopener noreferrer\">\n            \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u067e\u06cc\u0634\u0631\u0641\u062a\u0647 (\u062c\u0627\u0648\u0627)        <\/a>\n\n        <div class=\"course-price\">\n            \n                <span class=\"free-price\">\u0631\u0627\u06cc\u06af\u0627\u0646<\/span>\n\n                    <\/div>\n        <button class=\"course-cta-button\" data-course-url=\"https:\/\/maktabkhooneh.org\/course\/%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87-%D9%86%D9%88%DB%8C%D8%B3%DB%8C-%D9%BE%DB%8C%D8%B4%D8%B1%D9%81%D8%AA%D9%87-%D8%AC%D8%A7%D9%88%D8%A7-mk242\/\">\n            \u0645\u0634\u0627\u0647\u062f\u0647        <\/button>\n    <\/div>\n<\/div>\n<\/div><\/div><\/div>\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0622\u063a\u0627\u0632\u060c \u0628\u0631\u062e\u06cc \u0631\u0648\u0634\u200c\u0647\u0627 \u0628\u0631\u0627\u06cc \u0628\u0631\u062f\u0627\u0634\u062a\u0646 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0627\u0632 \u0633\u0631\u0648\u0631 \u0628\u062f\u0648\u0646 \u0628\u0627\u0632\u062e\u0648\u0627\u0646\u06cc \u0635\u0641\u062d\u0647 \u0648\u062c\u0648\u062f \u062f\u0627\u0634\u062a\u0647 \u0627\u0633\u062a\u060c \u0627\u0645\u0627 \u0622\u0646\u0647\u0627 \u0627\u063a\u0644\u0628 \u0628\u0647 \u062a\u06a9\u0646\u06cc\u06a9\u200c\u0647\u0627\u06cc \u067e\u06cc\u0686\u06cc\u062f\u0647 \u0645\u062a\u06a9\u06cc \u0628\u0648\u062f\u0646\u062f. \u0645\u0627\u06cc\u06a9\u0631\u0648\u0633\u0627\u0641\u062a XMLHttpRequest \u0631\u0627 \u0628\u0631\u0627\u06cc \u06cc\u06a9 \u0645\u0631\u0648\u0631\u06af\u0631 \u062c\u0627\u06cc\u06af\u0632\u06cc\u0646 \u0633\u0631\u0648\u06cc\u0633\u200c\u06af\u06cc\u0631\u0646\u062f\u0647 \u0627\u06cc\u0645\u06cc\u0644 Outlook \u062e\u0648\u062f \u06a9\u0631\u062f. XMLHttpRequest \u062f\u0631 \u0633\u0627\u0644 \u06f2\u06f0\u06f0\u06f6 \u0628\u0647 \u06cc\u06a9 \u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f \u0648\u0628 \u062a\u0628\u062f\u06cc\u0644 \u0634\u062f.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image alignnone size-full wp-image-13008\"><img decoding=\"async\" width=\"1280\" height=\"720\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2020\/11\/Fetch-API.jpg\" alt=\"\u0627\u0646\u0648\u0627\u0639 \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u062f\u0631 \u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\" class=\"wp-image-13008 lazyload\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2020\/11\/Fetch-API.jpg 1280w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2020\/11\/Fetch-API-300x169.jpg.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2020\/11\/Fetch-API-1024x576.jpg.webp 1024w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2020\/11\/Fetch-API-768x432.jpg.webp 768w\" data-sizes=\"(max-width: 1280px) 100vw, 1280px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1280px; --smush-placeholder-aspect-ratio: 1280\/720;\" \/><figcaption class=\"wp-element-caption\"><span style=\"font-size: 16px;\">\u0627\u0646\u0648\u0627\u0639 \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a<\/span><\/figcaption><\/figure>\n\n\n\n<p><span style=\"font-size: 16px;\">Fetch API \u062f\u0631 \u0633\u0627\u0644 \u06f2\u06f0\u06f1\u06f5 \u0628\u0627 ES6 \u0645\u0639\u0631\u0641\u06cc \u0634\u062f. \u0631\u0627\u0628\u0637\u200c\u0647\u0627\u06cc \u0639\u0645\u0648\u0645\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0648 \u067e\u0627\u0633\u062e \u0633\u0627\u0632\u06af\u0627\u0631\u06cc \u0631\u0627 \u0627\u0631\u0627\u0626\u0647 \u0645\u06cc\u200c\u062f\u0647\u0646\u062f \u062f\u0631\u062d\u0627\u0644\u06cc\u200c\u06a9\u0647 \u0648\u0639\u062f\u0647\u200c\u0647\u0627 (promises) \u0632\u0646\u062c\u06cc\u0631\u0647 \u0632\u0646\u06cc \u0622\u0633\u0627\u0646\u200c\u062a\u0631\u06cc \u0631\u0627 \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc\u200c\u06a9\u0646\u0646\u062f \u0648 \u0628\u062f\u0648\u0646 \u0628\u0627\u0632\u06af\u0634\u062a \u062a\u0645\u0627\u0633 \u0631\u0627 \u062f\u0631 \u062d\u0627\u0644\u062a \u0647\u0645\u06af\u0627\u0645\u200c\u0633\u0627\u0632\u06cc \u0642\u0631\u0627\u0631 \u0645\u06cc\u200c\u062f\u0647\u0646\u062f. \u0648\u0627\u06a9\u0634\u06cc \u062a\u0645\u06cc\u0632\u060c \u0632\u06cc\u0628\u0627 \u0648 \u0633\u0627\u062f\u0647 \u0627\u0633\u062a\u060c \u0627\u0645\u0627 \u06af\u0632\u06cc\u0646\u0647\u200c\u0647\u0627\u06cc \u062e\u0648\u0628 \u062f\u06cc\u06af\u0631\u06cc \u0646\u06cc\u0632 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f \u06a9\u0647 \u0628\u0647 \u0637\u0648\u0631 \u062e\u0644\u0627\u0635\u0647 \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0628\u0631\u0631\u0633\u06cc \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f \u0648 \u062f\u0631 \u0627\u062f\u0627\u0645\u0647 \u0628\u0647 \u0637\u0648\u0631 \u0645\u0641\u0635\u0644 \u062f\u0631 \u062e\u0635\u0648\u0635 \u0686\u0646\u062f \u0645\u0648\u0631\u062f \u062e\u062f\u0645\u062a \u0634\u0645\u0627 \u062a\u0648\u0636\u06cc\u062d\u0627\u062a\u06cc \u0631\u0627 \u0627\u0631\u0627\u0626\u0647 \u062e\u0648\u0627\u0647\u06cc\u0645 \u062f\u0627\u062f. \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e \u0634\u0627\u0645\u0644 \u0645\u0648\u0627\u0631\u062f \u0632\u06cc\u0631 \u0627\u0633\u062a:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-size: 16px;\">XMLHttpRequest<\/span><\/li>\n\n\n\n<li><span style=\"font-size: 16px;\">ajax<\/span><\/li>\n\n\n\n<li><span style=\"font-size: 16px;\">Qwest<\/span><\/li>\n\n\n\n<li><span style=\"font-size: 16px;\">SuperAgent<\/span><\/li>\n\n\n\n<li><span style=\"font-size: 16px;\">\u0645\u0634\u062a\u0631\u06cc Http<\/span><\/li>\n\n\n\n<li><span style=\"font-size: 16px;\">Axios<\/span><\/li>\n\n\n\n<li><span style=\"font-size: 16px;\">Fetch<\/span><\/li>\n<\/ul>\n\n\n\n<p><span style=\"font-size: 16px;\">\u06a9\u062f \u0632\u06cc\u0631 \u06cc\u06a9 \u0645\u062b\u0627\u0644 \u0627\u0633\u0627\u0633\u06cc HTTP GET \u0648 POST \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06af\u0632\u06cc\u0646\u0647\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0646\u0634\u0627\u0646 \u0645\u06cc\u200c\u062f\u0647\u062f.<\/span><\/p>\n\n\n<div class=\"jet-listing-grid--50192\" style=\"\"><style><\/style><section class=\"zht-related-post\" itemscope=\"\" itemtype=\"https:\/\/schema.org\/Article\" role=\"region\"\n  aria-label=\"Related article\">\n  <div class=\"zht-related-post-section-label\">\n    \u0645\u0637\u0627\u0644\u0628 \u0645\u0631\u062a\u0628\u0637\n  <\/div>\n  <img decoding=\"async\" width=\"300\" height=\"188\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2019\/08\/Lazy-Functions-Of-JavaScript-Main-Logo-640x400-1-300x188.png.webp\" class=\"attachment-medium size-medium wp-post-image lazyload\" alt=\"\u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0686\u06cc\u0633\u062a \u0648 \u0686\u0647 \u06a9\u0627\u0631\u0628\u0631\u062f\u06cc \u062f\u0627\u0631\u062f\u061f\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2019\/08\/Lazy-Functions-Of-JavaScript-Main-Logo-640x400-1-300x188.png.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2019\/08\/Lazy-Functions-Of-JavaScript-Main-Logo-640x400-1.png 640w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" title=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/188;\">\n  <a href=\"https:\/\/maktabkhooneh.org\/mag\/javascript-applications\/\" class=\"zht-related-post-title\"\n    itemprop=\"headline\" target=\"_blank\">\u0628\u0627 \u06a9\u0627\u0631\u0628\u0631\u062f\u0647\u0627\u06cc \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0648 \u062a\u0641\u0627\u0648\u062a \u062c\u0627\u0648\u0627 \u0648 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0622\u0634\u0646\u0627 \u0634\u0648\u06cc\u062f<\/a>\n<\/section><\/div>\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">XMLHttpRequest<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u0632 XMLHttpRequest \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0628\u0631\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u062f\u0627\u062f\u0647 \u0627\u0632 \u0633\u0631\u0648\u0631 \u0648\u0628 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f. \u0627\u06cc\u0646 \u0642\u062f\u06cc\u0645\u06cc\u200c\u062a\u0631\u06cc\u0646 \u0631\u0648\u0634 \u0627\u06cc\u0646 \u0645\u0642\u0627\u06cc\u0633\u0647 \u0627\u0633\u062a \u0648 \u0627\u06af\u0631\u0686\u0647 \u06af\u0632\u06cc\u0646\u0647\u200c\u0647\u0627\u06cc \u062f\u06cc\u06af\u0631 \u0627\u0632 \u0622\u0646 \u067e\u06cc\u0634\u06cc \u0645\u06cc\u200c\u06af\u06cc\u0631\u0646\u062f\u060c \u0627\u0645\u0627 \u0647\u0645\u0686\u0646\u0627\u0646 \u0633\u0627\u0632\u06af\u0627\u0631 \u0648 \u06a9\u0627\u0631\u0627 \u0627\u0633\u062a.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">GET<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">var req = new XMLHttpRequest();\/\/The onreadystatechange property\n\/\/specifies a function to be\n\/\/executed every time the status\n\/\/of the XMLHttpRequest changes\nreq.onreadystatechange = function() {\nif (this.readyState == 4 &amp;&amp; this.status == 200) {\n\/\/The responseText property\n\/\/returns a text string\nconsole.log(xhttp.responseText)\n\/\/Do some stuff\n}\n};req.open(\"GET\", \"http:\/\/dataserver\/users\", true);\nreq.send();<\/span><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">POST<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">var formData = new FormData();\nformData.append(\"name\", \"Milad\");\nvar req = new XMLHttpRequest();\nreq.open(\"POST\", \"http:\/\/dataserver\/update\");\nreq.send(formData);<\/span><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">JQuery.ajax<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u06cc\u0646 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u062a\u0627 \u0686\u0646\u062f\u06cc \u067e\u06cc\u0634 \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc \u0646\u0627\u0647\u0645\u200c\u0632\u0645\u0627\u0646 HTTP \u0628\u0647 \u0637\u0648\u0631 \u06af\u0633\u062a\u0631\u062f\u0647 \u0645\u0648\u0631\u062f\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0642\u0631\u0627\u0631 \u06af\u0631\u0641\u062a.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0647\u0645\u0647 \u0631\u0648\u0634\u200c\u0647\u0627\u06cc Ajax jQuery \u06cc\u06a9 \u0645\u062c\u0645\u0648\u0639\u0647 \u0628\u0632\u0631\u06af \u0627\u0632 \u0634\u06cc XMLHTTPRequest \u0631\u0627 \u0628\u0631\u0645\u06cc\u200c\u06af\u0631\u062f\u0627\u0646\u062f<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">GET<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">$.ajax({\nurl: 'http:\/\/dataserver\/data.json'\n}).done(function(data) {\n\/\/ ...do some stuff whith data\n}).fail(function() {\n\/\/ Handle error\n});<\/span><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">POST<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">$.ajax({\ntype: \"POST\",\nurl: 'http:\/\/dataserver\/update',\ndata: data,\nsuccess: successCallBack,\nerror: errorCallBack,\ndataType: dataType\n});<\/span><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">Qwest<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">Qwest \u06cc\u06a9 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0622\u0698\u0627\u06a9\u0633 \u0633\u0627\u062f\u0647 \u0627\u0633\u062a \u06a9\u0647 \u0628\u0631 \u0627\u0633\u0627\u0633 \u0648\u0639\u062f\u0647\u200c\u0647\u0627 \u06cc\u0627 (Promises) \u0627\u0631\u0627\u0626\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a \u0648 \u0627\u0632 \u062f\u0627\u062f\u0647\u200c\u0647\u0627\u06cc \u0645\u0646\u062d\u0635\u0631\u0628\u0647\u200c\u0641\u0631\u062f XmlHttpRequest2 \u0645\u0627\u0646\u0646\u062f ArrayBuffer \u060c Blob \u0648 FormData \u067e\u0634\u062a\u06cc\u0628\u0627\u0646\u06cc \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">GET<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">qwest.get('http:\/\/dataserver\/data.json')\n.then(function(xhr, response) {\n\/\/ ...do some stuff whith data\n});<\/span><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">POST<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">qwest.post('http:\/\/dataserver\/update', {\nfirstname: 'Milad',\nage: 30\n})\n.then(function(xhr, response) {\n\/\/ Make some useful actions\n})\n.catch(function(e, xhr, response) {\n\/\/ Process the error\n});<\/span><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">SuperAgent<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">SuperAgent ajax API \u0627\u0633\u062a \u06a9\u0647 \u0628\u0631\u0627\u06cc \u0627\u0646\u0639\u0637\u0627\u0641\u200c\u067e\u0630\u06cc\u0631\u06cc\u060c \u062e\u0648\u0627\u0646\u0627\u06cc\u06cc \u0648 \u0628\u0627 \u0645\u0646\u062d\u0646\u06cc \u06cc\u0627\u062f\u06af\u06cc\u0631\u06cc \u06a9\u0645 \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647 \u0627\u0633\u062a. \u0647\u0645\u0686\u0646\u06cc\u0646 \u0628\u0627 Node.js \u06a9\u0627\u0631 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">GET<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">request('GET', 'http:\/\/dataserver\/data.json').then(\nsuccess, failure);<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0645\u062a\u062f . query () &nbsp;\u0627\u0634\u06cc\u0627 \u0631\u0627 \u0645\u06cc\u200c\u067e\u0630\u06cc\u0631\u062f \u06a9\u0647 \u0627\u06af\u0631 \u0628\u0627 \u0631\u0648\u0634 GET \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0634\u0648\u062f\u060c \u06cc\u06a9\u200c\u0631\u0634\u062a\u0647 query \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0645\u0648\u0627\u0631\u062f \u0632\u06cc\u0631 \u0645\u0633\u06cc\u0631 \/ dataserver \/ search\u061f name = Manny &amp; lastName = Peck &amp; order = desc \u0631\u0627 \u062a\u0648\u0644\u06cc\u062f \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">request\n.get('\/dataserver\/search')\n.query({ name: 'Templeton' })\n.query({ lastname: 'Peck' })\n.query({ order: 'desc' })\n.then(res =&gt; {console.dir(res)}\n});<\/span><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">POST<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">request\n.post('http:\/\/dataserver\/update')\n.send({ name: 'Milad' })\n.set('Accept', 'application\/json')\n.then(res =&gt; {\nconsole.log('result' + JSON.stringify(res.body));\n});<\/span><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\"><strong>GET<\/strong><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">\/\/using ES6 modules\nimport { createFetch, base, accept, parse } from 'http-client'const fetch = createFetch(\nbase('http:\/\/dataserver\/data.json'),\naccept('application\/json'),\nparse('json')\n)fetch('http:\/\/dataserver\/data.json').then(response =&gt; {\nconsole.log(response.jsonData)\n})<\/span><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">POST<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">\/\/using ES6 modules\nimport { createFetch, method, params } from 'http-client'const fetch = createFetch(\nparams({ name: '' }),\nbase('http:\/\/dataserver\/update')\n)<\/span><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">Axios<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 HTTP \u0645\u0628\u062a\u0646\u06cc \u0628\u0631 \u0648\u0639\u062f\u0647 (promise) \u0628\u0631\u0627\u06cc \u0627\u0646\u062c\u0627\u0645 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc HTTP \u062f\u0631 \u0645\u0631\u0648\u0631\u06af\u0631 \u0648 Nodejs<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">GET<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">axios({\nurl: 'http:\/\/dataserver\/data.json',\nmethod: 'get'\n})<\/span><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">POST<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">axios.post('http:\/\/dataserver\/update', {\nname: ''\n})\n.then(function (response) {\nconsole.log(response);\n})\n.catch(function (error) {\nconsole.log(error);\n});<\/span><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">FETCH<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">Fetch \u06cc\u06a9 API \u0645\u0631\u0648\u0631\u06af\u0631 \u0628\u0648\u0645\u06cc \u0627\u0633\u062a \u062a\u0627 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc \u0631\u0627 \u062c\u0627\u06cc\u06af\u0632\u06cc\u0646 XMLHttpRequest \u06a9\u0646\u062f. Fetch \u0627\u062c\u0627\u0632\u0647 \u0645\u06cc\u200c\u062f\u0647\u062f \u062a\u0627 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc \u0634\u0628\u06a9\u0647 \u0631\u0627 \u0622\u0633\u0627\u0646\u200c\u062a\u0631 \u0627\u0632 XMLHttpRequest \u0627\u0639\u0645\u0627\u0644 \u06a9\u0646\u06cc\u062f. Fetch API \u0627\u0632 promises \u0628\u0631\u0627\u06cc \u062c\u0644\u0648\u06af\u06cc\u0631\u06cc \u0627\u0632 \u0627\u062e\u062a\u0644\u0627\u0644 \u067e\u0627\u0633\u062e\u06af\u0648\u06cc\u06cc XMLHttpRequest \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">GET<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">\/\/With ES6 fetch\nfetch('http:\/\/dataserver\/data.json')\n.then(data =&gt; {\n\/\/ ...do some stuff whith data\n}).catch(error =&gt; {\n\/\/ Handle error\n});<\/span><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">POST<\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">fetch('http:\/\/dataserver\/update', {\nmethod: 'post',\nheaders: {\n'Accept': 'application\/json, text\/plain, *\/*',\n'Content-Type': 'application\/json'\n},\nbody: JSON.stringify({name: 'Milad'})\n}).then(res=&gt;res.json())\n.then(res =&gt; console.log(res));\/\/OR with ES2017 for example(async () =&gt; {<\/span><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">const response = await fetch(\u2018http:\/\/dataserver\/update\u2019, {\nmethod: \u2018POST\u2019,\nheaders: {\n\u2018Accept\u2019: \u2018application\/json\u2019,\n\u2018Content-Type\u2019: \u2018application\/json\u2019\n},\nbody: JSON.stringify({name:\u2019\u2019})\n});const result = await response.json();console.log(result);\n})();\n\n\n<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u0645\u0627 \u0628\u067e\u0631\u062f\u0627\u0632\u06cc\u0645 \u0628\u0647 \u0645\u0647\u0645\u200c\u062a\u0631\u06cc\u0646 \u0628\u062e\u0634 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u06a9\u0647 \u0628\u0647 \u0637\u0648\u0631 \u0645\u0641\u0635\u0644 \u0631\u0648\u0634 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u062c\u0627 \u0648 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0631\u0627 \u0628\u0631\u0627\u06cc \u0686\u0646\u062f\u06cc\u0646 \u0631\u0648\u0634 \u06a9\u0647 \u062f\u0631 \u0628\u0627\u0644\u0627 \u0627\u0634\u0627\u0631\u0647 \u0634\u062f \u062a\u0648\u0636\u06cc\u062d \u0645\u06cc\u200c\u062f\u0647\u06cc\u0645:<\/span><\/p>\n\n\n<div class=\"jet-listing-grid--50192\" style=\"\"><section class=\"zht-related-post\" itemscope=\"\" itemtype=\"https:\/\/schema.org\/Article\" role=\"region\"\n  aria-label=\"Related article\">\n  <div class=\"zht-related-post-section-label\">\n    \u0645\u0637\u0627\u0644\u0628 \u0645\u0631\u062a\u0628\u0637\n  <\/div>\n  <img decoding=\"async\" width=\"300\" height=\"188\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2019\/08\/Lazy-Functions-Of-JavaScript-Main-Logo-640x400-1-300x188.png.webp\" class=\"attachment-medium size-medium wp-post-image lazyload\" alt=\"\u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0686\u06cc\u0633\u062a \u0648 \u0686\u0647 \u06a9\u0627\u0631\u0628\u0631\u062f\u06cc \u062f\u0627\u0631\u062f\u061f\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2019\/08\/Lazy-Functions-Of-JavaScript-Main-Logo-640x400-1-300x188.png.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2019\/08\/Lazy-Functions-Of-JavaScript-Main-Logo-640x400-1.png 640w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" title=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/188;\">\n  <a href=\"https:\/\/maktabkhooneh.org\/mag\/javascript-applications\/\" class=\"zht-related-post-title\"\n    itemprop=\"headline\" target=\"_blank\">\u0628\u0627 \u06a9\u0627\u0631\u0628\u0631\u062f\u0647\u0627\u06cc \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0648 \u062a\u0641\u0627\u0648\u062a \u062c\u0627\u0648\u0627 \u0648 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0622\u0634\u0646\u0627 \u0634\u0648\u06cc\u062f<\/a>\n<\/section><\/div>\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u062f\u0631\u062e\u0648\u0627\u0633\u062a \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a XHR<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u06af\u0631 \u0645\u062f\u062a \u0632\u06cc\u0627\u062f\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0628\u0627 JavaScript \u06a9\u0627\u0631 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f\u060c \u0627\u062d\u062a\u0645\u0627\u0644\u0627\u064b \u0634\u0646\u06cc\u062f\u0647\u200c\u0627\u06cc\u062f \u06a9\u0647 XMLHttpRequest (XHR) \u06cc\u06a9\u06cc \u0627\u0632 \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u0633\u062a. \u0631\u0648\u0634 XHR \u06a9\u0627\u0645\u0644\u0627\u064b \u0642\u062f\u0631\u062a\u0645\u0646\u062f \u0627\u0633\u062a \u0632\u06cc\u0631\u0627 \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u06cc\u06a9 \u0645\u0646\u0628\u0639 \u0627\u0632 \u0631\u0627\u0647 \u062f\u0648\u0631 \u062f\u0627\u062f\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0646\u06cc\u062f\u060c \u0627\u0632 \u06cc\u06a9 \u0645\u0646\u0628\u0639 \u0627\u0632 \u0631\u0627\u0647 \u062f\u0648\u0631 \u062f\u0627\u062f\u0647 \u062f\u0631\u06cc\u0627\u0641\u062a \u06a9\u0646\u06cc\u062f \u06cc\u0627 \u0628\u0647 \u06cc\u06a9 \u0645\u0646\u0628\u0639 \u0627\u0632 \u0631\u0627\u0647 \u062f\u0648\u0631 \u062f\u0627\u062f\u0647 \u0627\u0631\u0633\u0627\u0644 \u06a9\u0646\u06cc\u062f. \u062a\u0645\u0627\u0645 \u0622\u0646\u0686\u0647 \u06a9\u0647 \u0630\u06a9\u0631 \u0634\u062f \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0634\u0628\u06cc\u0647 \u0628\u0647 \u0647\u0645 \u0628\u0627\u0634\u0646\u062f\u060c \u0627\u0645\u0627 \u0622\u0646\u0647\u0627 \u0628\u062e\u0634\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0641\u0631\u0627\u06cc\u0646\u062f HTTP \u0647\u0633\u062a\u0646\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0628\u06cc\u0627\u06cc\u06cc\u062f \u0646\u06af\u0627\u0647\u06cc \u0628\u0647 \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627 \u0628\u06cc\u0646\u062f\u0627\u0632\u06cc\u0645:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">const xhr = new XMLHttpRequest();\n\nxhr.onreadystatechange = () =&gt; {\n\n&nbsp;&nbsp;&nbsp; if(xhr.readyState == 4 &amp;&amp; xhr.status == 200) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(xhr.responseText);\n\n&nbsp;&nbsp;&nbsp; }\n\n};\n\nxhr.open(\"GET\", \"http:\/\/httpbin.org\/get\", true);\n\nxhr.send();<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0645\u062b\u0627\u0644 \u0628\u0627\u0644\u0627 \u0645\u0627 \u062f\u0631 \u062d\u0627\u0644 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u0634\u06cc \u062c\u062f\u06cc\u062f XMLHttpRequest \u0647\u0633\u062a\u06cc\u0645. \u0627\u06af\u0631 \u0628\u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0627\u0631\u06cc \u0631\u0627 \u0628\u0627 \u0646\u062a\u06cc\u062c\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u0645\u060c \u0628\u0627\u06cc\u062f \u0628\u0627 \u0645\u0628\u062d\u062b \u062a\u063a\u06cc\u06cc\u0631 listener \u0622\u0634\u0646\u0627 \u0634\u0648\u06cc\u0645. \u062f\u0631 \u0645\u062b\u0627\u0644 \u0645\u0630\u06a9\u0648\u0631\u060c \u0627\u0628\u062a\u062f\u0627 \u0628\u0627\u06cc\u062f \u0628\u0631\u0631\u0633\u06cc \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645 \u06a9\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0627\u0645\u0644 \u0628\u0627\u0634\u062f\u060c \u0627\u0632\u0627\u06cc\u0646\u200c\u0631\u0648 \u0627\u06af\u0631 \u0645\u0642\u062f\u0627\u0631 readyState \u0628\u0631\u0627\u0628\u0631 \u06f4 \u0628\u0627\u0634\u062f \u06a9\u062f \u0645\u0627 \u0628\u0627 \u0645\u0648\u0641\u0642\u06cc\u062a \u06a9\u0627\u0631\u06a9\u0631\u062f\u0647 \u0648 \u06a9\u062f \u062f\u0631\u0633\u062a \u0627\u0633\u062a.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0686\u0647\u0627\u0631 \u0645\u0642\u062f\u0627\u0631 \u0645\u062e\u062a\u0644\u0641 \u062d\u0627\u0644\u062a readyState \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u062f\u0631 \u0645\u0633\u062a\u0646\u062f\u0627\u062a MDN \u0628\u0631\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc XHR \u06cc\u0627\u0641\u062a \u067e\u0633 \u0632\u062d\u0645\u062a \u0628\u06a9\u0634\u06cc\u062f \u0642\u0628\u0644 \u0627\u0632 \u0647\u0631 \u0686\u06cc\u0632 \u0628\u0627 \u0627\u06cc\u0646 \u0686\u0647\u0627\u0631 \u0645\u0642\u062f\u0627\u0631 \u0622\u0634\u0646\u0627 \u0634\u0648\u06cc\u062f. \u0627\u06af\u0631 \u0627\u06cc\u0646 \u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u062f \u062a\u0639\u062f\u0627\u062f \u06a9\u0645\u06cc \u0627\u0632 \u06a9\u062f\u0647\u0627\u06cc \u0648\u0636\u0639\u06cc\u062a\u06cc \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f \u06a9\u0647 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u0646\u062f \u0627\u0632 \u0633\u0631\u0648\u0631 \u0628\u0631\u06af\u0631\u062f\u0627\u0646\u062f\u0647 \u0634\u0648\u0646\u062f. \u062f\u0631 \u06cc\u06a9 \u0633\u0646\u0627\u0631\u06cc\u0648 \u0648\u0627\u0642\u0639\u200c\u0628\u06cc\u0646\u0627\u0646\u0647\u060c \u0634\u0645\u0627 \u0627\u062d\u062a\u0645\u0627\u0644\u0627\u064b \u0645\u06cc\u200c\u062e\u0648\u0627\u0647\u06cc\u062f \u0647\u0645\u0647 \u0627\u0645\u06a9\u0627\u0646\u0627\u062a \u0628\u0631\u0627\u06cc \u0628\u0647\u062a\u0631\u06cc\u0646 \u062a\u062c\u0631\u0628\u0647 \u06a9\u0627\u0631\u0628\u0631 \u0631\u0627 \u062f\u0631 \u062e\u0648\u062f \u062c\u0627\u06cc \u062f\u0647\u06cc\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0645\u062b\u0627\u0644\u060c \u067e\u0627\u0633\u062e \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0641\u0642\u0637 \u062f\u0631 \u0642\u0633\u0645\u062a \u0644\u0627\u06af \u0642\u0627\u0628\u0644\u200c\u0645\u0634\u0627\u0647\u062f\u0647 \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f. \u0647\u0646\u06af\u0627\u0645 \u0628\u0627\u0632\u06a9\u0631\u062f\u0646 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u060c URL \u0645\u0634\u062e\u0635 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062d\u0627\u0644\u0627 \u0628\u06cc\u0627\u06cc\u06cc\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a XHR \u0631\u0627 \u06a9\u0645\u06cc \u067e\u06cc\u0686\u06cc\u062f\u0647 \u06a9\u0646\u06cc\u0645. \u0628\u06cc\u0627\u06cc\u06cc\u062f \u0645\u0648\u0627\u0631\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u0645:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">const xhr = new XMLHttpRequest();\n\nxhr.onreadystatechange = () =&gt; {\n\n&nbsp;&nbsp;&nbsp; if(xhr.readyState == 4 &amp;&amp; xhr.status == 200) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(xhr.responseText);\n\n&nbsp;&nbsp;&nbsp; }\n\n};\n\nxhr.open(\"POST\", \"http:\/\/httpbin.org\/post?key=123\", true);\n\nxhr.send(JSON.stringify({ \"firstname\": \"\", \"lastname\": \"Vahidi\" }));<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u06a9\u062f \u0628\u0627\u0644\u0627\u060c \u0645\u0627 \u0627\u06a9\u0646\u0648\u0646 \u06cc\u06a9 \u062f\u0631\u062e\u0648\u0627\u0633\u062a POST \u0628\u0627 \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u0647\u0627\u06cc \u06a9\u0648\u0626\u0631\u06cc (query parameters) \u0648 \u06cc\u06a9 \u0628\u062f\u0646\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a (body request) \u0627\u06cc\u062c\u0627\u062f \u06a9\u0631\u062f\u0647\u200c\u0627\u06cc\u0645. \u062a\u0648\u062c\u0647 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 \u0645\u0627 \u0628\u0627\u06cc\u062f \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u0647\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0631\u0627 \u0627\u0632 \u0637\u0631\u06cc\u0642 url \u0631\u0645\u0632\u06af\u0630\u0627\u0631\u06cc \u06a9\u0646\u06cc\u0645 \u0648 \u0647\u0645\u0686\u0646\u06cc\u0646 \u0645\u062a\u0646 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0631\u0627 \u0628\u0647\u200c\u0635\u0648\u0631\u062a \u0633\u0631\u06cc\u0627\u0644\u0627\u06cc\u0632 \u0634\u062f\u0647 \u062a\u0646\u0638\u06cc\u0645 \u06a9\u0646\u06cc\u0645.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">XMLHttpRequest \u0642\u062f\u0631\u062a\u0645\u0646\u062f \u0627\u0633\u062a\u060c \u0627\u0645\u0627 \u0628\u0647 \u0646\u0638\u0631 \u0645\u0646 \u0645\u0634\u06a9\u0644 \u0628\u06cc\u0634 \u0627\u0632 \u0627\u0631\u0632\u0634 \u0622\u0646 \u0627\u0633\u062a. \u0627\u06cc\u0646 \u0627\u0645\u0631 \u0645\u0627 \u0631\u0627 \u0628\u0647 \u0631\u0648\u06cc\u06a9\u0631\u062f\u0647\u0627\u06cc \u0645\u062f\u0631\u0646\u200c\u062a\u0631\u06cc \u0646\u0633\u0628\u062a \u0628\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc HTTP \u0628\u0627 JavaScript \u0647\u062f\u0627\u06cc\u062a \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0627\u0632 \u0637\u0631\u06cc\u0642 JavaScript Fetch Request<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0639\u0645\u0644\u06a9\u0631\u062f \u0648\u0627\u06a9\u0634\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0634\u0645\u0627 \u0631\u0627 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f \u0648 \u0646\u062a\u06cc\u062c\u0647 \u0645\u0639\u0631\u0648\u0641 \u0628\u0647 promise \u0631\u0627 \u067e\u0633 \u0645\u06cc\u200c\u062f\u0647\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u06cc\u0627\u06cc\u06cc\u062f \u0646\u06af\u0627\u0647\u06cc \u0628\u06cc\u0646\u062f\u0627\u0632\u06cc\u0645 \u0628\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a XHR \u0628\u0627 \u0627\u06cc\u0646 \u062a\u0641\u0627\u0648\u062a \u06a9\u0647 \u062f\u0631 \u0627\u06cc\u0646 \u0642\u0633\u0645\u062a \u0627\u0632 \u0648\u0627\u06a9\u0634\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">fetch(\"http:\/\/httpbin.org\/get\")\n\n&nbsp;&nbsp;&nbsp; .then(response =&gt; response.json())\n\n&nbsp;&nbsp;&nbsp; .then(response =&gt; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(response);\n\n&nbsp;&nbsp;&nbsp; }, error =&gt; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.error(error);\n\n&nbsp;&nbsp;&nbsp; });<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0647\u200c\u062c\u0627\u06cc \u0646\u06af\u0631\u0627\u0646\u06cc \u062f\u0631 \u0645\u0648\u0631\u062f \u0627\u06cc\u062c\u0627\u062f listener \u06cc\u0627 \u0646\u06af\u0631\u0627\u0646\u06cc \u062f\u0631 \u0645\u0648\u0631\u062f \u06a9\u062f \u0648\u0636\u0639\u06cc\u062a \u067e\u0627\u0633\u062e\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u0645 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u0645 \u06a9\u0647 \u0622\u06cc\u0627 promise \u0645\u0648\u0641\u0642\u06cc\u062a\u200c\u0622\u0645\u06cc\u0632 \u0628\u0648\u062f\u0647 \u06cc\u0627 \u0631\u062f \u0634\u062f\u0647 \u0627\u0633\u062a. \u0639\u0645\u0644\u06a9\u0631\u062f \u0648\u0627\u06a9\u0634\u06cc \u06cc\u06a9 promise \u0628\u0627 \u062f\u0627\u062f\u0647\u200c\u0647\u0627\u06cc \u062e\u0627\u0645 \u0631\u0627 \u0645\u06cc\u200c\u062f\u0647\u062f \u06a9\u0647 \u0628\u0627\u06cc\u062f \u0628\u0647 JSON\u060c \u0645\u062a\u0646 \u06cc\u0627 \u0645\u0648\u0627\u0631\u062f \u062f\u06cc\u06af\u0631 \u062a\u0628\u062f\u06cc\u0644 \u0634\u0648\u062f. \u0628\u0647 \u0647\u0645\u06cc\u0646 \u062f\u0644\u06cc\u0644 \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0632\u0646\u062c\u06cc\u0631\u0647 promise \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0646\u062a\u06cc\u062c\u0647 \u0646\u0647\u0627\u06cc\u06cc \u0627\u06cc\u0646 \u06a9\u062f \u062e\u0627\u0635 \u0628\u0647\u200c\u0635\u0648\u0631\u062a JSON \u0628\u0631\u06af\u0631\u062f\u0627\u0646\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f\u060c \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0622\u0646 \u0631\u0627 \u0628\u0647 \u0647\u0645\u06cc\u0646 \u0635\u0648\u0631\u062a\u06cc \u06a9\u0647 \u0647\u0633\u062a \u062a\u0628\u062f\u06cc\u0644 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645 \u0642\u0628\u0644 \u0627\u0632 \u0627\u06cc\u0646\u06a9\u0647 \u0622\u0646 \u0631\u0627 \u062f\u0631 \u0632\u0646\u062c\u06cc\u0631 \u06a9\u0631\u062f\u0646 \u0628\u0647 \u06cc\u06a9 \u062d\u0644\u0642\u0647 \u062c\u062f\u06cc\u062f \u062f\u0631 \u0632\u0646\u062c\u06cc\u0631\u0647 promise \u062f\u0631\u06af\u06cc\u0631 \u06a9\u0646\u06cc\u0645.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u06af\u0631\u0686\u0647 \u0648\u0627\u06a9\u0634\u06cc \u0628\u0631\u0627\u06cc \u0628\u0633\u06cc\u0627\u0631\u06cc \u0627\u0632 \u0645\u0648\u0642\u0639\u06cc\u062a\u200c\u0647\u0627 \u0628\u0633\u06cc\u0627\u0631 \u0642\u062f\u0631\u062a\u0645\u0646\u062f \u0627\u0633\u062a\u060c \u0627\u0645\u0627 \u06af\u0627\u0647\u06cc \u0627\u0648\u0642\u0627\u062a \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0646\u06cc\u0627\u0632 \u0628\u0647\u060c \u0628\u0647\u200c\u06a9\u0627\u0631\u06af\u06cc\u0631\u06cc \u0638\u0631\u0627\u0641\u062a \u062e\u0627\u0635\u06cc \u0646\u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f. \u0627\u062c\u0627\u0632\u0647 \u062f\u0647\u06cc\u062f \u0628\u0631\u062e\u06cc \u0645\u0648\u0627\u0631\u062f \u0631\u0627 \u062f\u0631 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u062e\u0648\u062f \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0647\u06cc\u0645:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">fetch(\"http:\/\/httpbin.org\/post?key=123\", {\n\n&nbsp;&nbsp;&nbsp; \"method\": \"POST\",\n\n&nbsp;&nbsp;&nbsp; \"body\": JSON.stringify({\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"firstname\": \"\",\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"lastname\": \"Vahidi\"\n\n&nbsp;&nbsp;&nbsp; })\n\n})\n\n.then(response =&gt; response.json())\n\n.then(response =&gt; {\n\n&nbsp;&nbsp;&nbsp; console.log(response);\n\n});<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0641\u0648\u0642\u060c \u0645\u0627 \u062f\u0631 \u062d\u0627\u0644 \u062a\u063a\u06cc\u06cc\u0631 \u0627\u0632 GET \u0628\u0647 POST \u0647\u0633\u062a\u06cc\u0645 \u0648 \u062f\u0631 \u062d\u0627\u0644 \u062a\u0632\u0631\u06cc\u0642 request body \u0648 \u0647\u0645\u0686\u0646\u06cc\u0646 query parameters \u0647\u0633\u062a\u06cc\u0645. \u062a\u0648\u062c\u0647 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 query parameters \u0645\u0633\u062a\u0642\u06cc\u0645\u0627\u064b \u0628\u0627 URL \u062f\u0631 \u06cc\u06a9 \u062e\u0637 \u0642\u0631\u0627\u0631 \u062f\u0627\u0631\u0646\u062f \u0648 equest body \u06cc\u06a9 serialized JSON object \u0627\u0633\u062a.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0631\u0627\u06cc \u0628\u0647\u0628\u0648\u062f \u06a9\u0627\u0631\u0647\u0627\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u0645 \u0628\u0647 \u0633\u0645\u062a \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0634\u062e\u0635 \u062b\u0627\u0644\u062b\u06cc \u0628\u0631\u0648\u06cc\u0645 \u06a9\u0647 \u062f\u0631 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc JavaScript \u0645\u0627 \u0645\u0648\u0631\u062f\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0642\u0631\u0627\u0631 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc HTTP \u0628\u0627 Axios JavaScript Library<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u06cc\u06a9\u06cc \u0627\u0632 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647\u200c\u0647\u0627\u06cc \u0645\u0647\u0645 \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP\u060c \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 axios \u0627\u0633\u062a.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u06af\u0631 \u0627\u0632 NPM \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">npm install axios \u2013save<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u06af\u0631 \u0627\u0632 Node.js \u06cc\u0627 \u06cc\u06a9 \u0686\u0627\u0631\u0686\u0648\u0628 \u0645\u062f\u0631\u0646 \u062d\u0627\u0648\u06cc Webpack \u06cc\u0627 \u0645\u0648\u0627\u0631\u062f \u0645\u0634\u0627\u0628\u0647 \u062f\u06cc\u06af\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f\u060c \u062f\u0633\u062a\u0648\u0631 \u0641\u0648\u0642 \u0639\u0627\u0644\u06cc \u06a9\u0627\u0631 \u062e\u0648\u0627\u0647\u062f \u06a9\u0631\u062f\u060c \u0627\u0645\u0627 \u0647\u0646\u06af\u0627\u0645 \u0633\u0627\u062e\u062a \u06cc\u06a9 \u0628\u0631\u0646\u0627\u0645\u0647 \u06a9\u0627\u0631\u0628\u0631\u062f\u06cc \u0645\u0628\u062a\u0646\u06cc \u0628\u0631 \u0645\u0631\u0648\u0631\u06af\u0631 \u0628\u0627 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u06a9\u0645\u06a9 \u0686\u0646\u062f\u0627\u0646\u06cc \u0646\u0645\u06cc\u200c\u06a9\u0646\u062f. \u062f\u0631 \u0639\u0648\u0636\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0631\u0627 \u0628\u0627 \u062a\u06af \u0632\u06cc\u0631 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">&lt;script src=\"https:\/\/unpkg.com\/axios\/dist\/axios.min.js\"&gt;&lt;\/script&gt;<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u0632\u0622\u0646\u062c\u0627\u06a9\u0647 \u0627\u06cc\u0646 \u06cc\u06a9 \u0645\u062b\u0627\u0644 \u06cc\u06a9 \u0645\u0628\u062d\u062b \u067e\u0627\u06cc\u0647\u200c\u0627\u06cc \u0648 \u0628\u0646\u06cc\u0627\u062f\u06cc \u062f\u0631 JavaScript \u0627\u0633\u062a\u060c \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u06afscript &nbsp;\u062e\u0648\u0628 \u0627\u0633\u062a\u060c \u062a\u0648\u062c\u0647 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 \u0627\u06af\u0631 \u0627\u0632 \u0631\u0648\u06cc\u06a9\u0631\u062f NPM \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f\u060c \u0641\u0631\u0627\u0645\u0648\u0634 \u0646\u06a9\u0646\u06cc\u062f \u06a9\u0647 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0631\u0627 \u062f\u0631 \u0641\u0627\u06cc\u0644 JavaScript \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06a9\u062f \u0632\u06cc\u0631\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 axios \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">axios({\n\n&nbsp;&nbsp;&nbsp; \"method\": \"GET\",\n\n&nbsp;&nbsp;&nbsp; \"url\": \"http:\/\/httpbin.org\/get\"\n\n}).then(response =&gt; {\n\n&nbsp;&nbsp;&nbsp; console.log(response.data);\n\n});<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u06a9\u062f \u0641\u0648\u0642 \u0646\u0633\u062e\u0647 \u0627\u0635\u0644\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0627\u0628\u0639 \u0648\u0627\u06a9\u0634\u06cc \u06cc\u0627 XMLHttpRequest \u0627\u0633\u062a. \u0645\u0627\u0646\u0646\u062f \u0639\u0645\u0644\u06a9\u0631\u062f \u0648\u0627\u06a9\u0634\u06cc\u060c \u062e\u0631\u0648\u062c\u06cc \u0631\u0648\u06cc\u06a9\u0631\u062f axios \u06cc\u06a9 promise \u0627\u0633\u062a.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0645\u0648\u0627\u0631\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0645\u062b\u0627\u0644 \u062f\u0631 \u0646\u0638\u0631 \u0628\u06af\u06cc\u0631\u06cc\u062f:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">axios({\n\n&nbsp;&nbsp;&nbsp; \"method\": \"POST\",\n\n&nbsp;&nbsp;&nbsp; \"url\": \"http:\/\/httpbin.org\/post\",\n\n&nbsp;&nbsp;&nbsp; \"params\": {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"key\": \"123\"\n\n&nbsp;&nbsp;&nbsp; },\n\n&nbsp;&nbsp;&nbsp; \"data\": {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"firstname\": \"\",\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \"lastname\": \"Vahidi\"\n\n&nbsp;&nbsp;&nbsp; }\n\n}).then(response =&gt; {\n\n&nbsp;&nbsp;&nbsp; console.log(response.data);\n\n});<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062a\u0648\u062c\u0647 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 \u0645\u0627 \u0627\u06cc\u0646 \u0628\u0627\u0631 \u0631\u0648\u0634 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0631\u0627 \u0628\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a POST \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0627\u062f\u0647\u200c\u0627\u06cc\u0645. \u062f\u0631 \u0627\u06cc\u0646 \u0642\u0633\u0645\u062a \u062a\u0635\u0645\u06cc\u0645 \u06af\u0631\u0641\u062a\u06cc\u0645 \u06a9\u0647 \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u0647\u0627\u06cc \u062c\u0633\u062a\u062c\u0648 \u0631\u0627 \u062f\u0631 URL \u0628\u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0647 \u0627\u0632 \u0637\u0631\u06cc\u0642 \u0634\u06cc params \u0648 \u06cc\u06a9 \u0628\u062f\u0646\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0647 \u0628\u0647 \u0634\u06cc \u062f\u0627\u062f\u0647 \u0627\u0636\u0627\u0641\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a\u060c \u0627\u0636\u0627\u0641\u0647 \u0634\u0648\u0646\u062f. \u0627\u0644\u0628\u062a\u0647 \u0646\u06cc\u0627\u0632\u06cc \u0646\u0628\u0648\u062f \u06a9\u0647 \u0627\u06cc\u0646 \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u0647\u0627 \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 url \u0631\u0645\u0632\u06af\u0630\u0627\u0631\u06cc \u06a9\u0646\u06cc\u0645 \u06cc\u0627 \u0645\u062a\u0646 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0631\u0627 \u0633\u0631\u06cc\u0627\u0644\u200c\u0633\u0627\u0632\u06cc \u06a9\u0646\u06cc\u0645 \u0628\u0647\u200c\u0648\u06cc\u0698\u0647 \u0647\u0646\u06af\u0627\u0645\u06cc\u200c\u06a9\u0647 \u062a\u0639\u062f\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc \u0632\u06cc\u0627\u062f\u06cc \u062f\u0627\u0631\u06cc\u062f \u06cc\u0627 \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u0647\u0627\u06cc \u062c\u0633\u062a\u062c\u0648\u06cc \u0632\u06cc\u0627\u062f\u06cc \u062f\u0627\u0631\u06cc\u062f. \u062d\u062a\u06cc \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0647\u062f\u0631 \u0631\u0627 \u0646\u06cc\u0632 \u062f\u0631 \u0627\u06cc\u0646 \u0628\u062e\u0634 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0646\u062a\u06cc\u062c\u0647 \u06af\u06cc\u0631\u06cc<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0686\u0646\u062f \u06af\u0632\u06cc\u0646\u0647 \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc HTTP \u062f\u0631 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc JavaScript \u0631\u0627 \u0645\u0634\u0627\u0647\u062f\u0647 \u06a9\u0631\u062f\u06cc\u062f. \u0631\u0648\u06cc\u06a9\u0631\u062f\u0647\u0627\u06cc \u0630\u06a9\u0631 \u0634\u062f\u0647\u060c \u062f\u0631 \u0628\u0631\u062e\u06cc \u0634\u0631\u0627\u06cc\u0637\u060c \u0628\u0627\u06cc\u062f \u0641\u0631\u0627\u062a\u0631 \u0627\u0632 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc \u0648\u0628 \u0628\u0627\u0634\u062f. \u0627\u06cc\u0646 \u0628\u062f\u0627\u0646 \u0645\u0639\u0646\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0634\u0645\u0627 \u0628\u0627\u06cc\u062f \u0628\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0631\u0648\u06cc\u06a9\u0631\u062f\u0647\u0627\u06cc \u0630\u06a9\u0631 \u0634\u062f\u0647 \u062f\u0631 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc \u0645\u0628\u062a\u0646\u06cc \u0628\u0631 \u0645\u0631\u0648\u0631\u06af\u0631\u060c \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc backend\u060c \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc \u062a\u0644\u0641\u0646 \u0647\u0645\u0631\u0627\u0647 \u06a9\u0631\u0627\u0633 \u067e\u0644\u062a\u0641\u0631\u0645 \u0648 \u0645\u0648\u0627\u0631\u062f \u062f\u06cc\u06af\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full wp-image-13009\"><img decoding=\"async\" width=\"600\" height=\"260\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2020\/11\/\u062f\u0631\u062e\u0648\u0627\u0633\u062a-\u0647\u0627-\u0648-\u067e\u0627\u0633\u062e-\u0647\u0627-\u062f\u0631-HTTPRequest.jpg\" alt=\"\u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627 \u0648 \u067e\u0627\u0633\u062e \u0647\u0627 \u062f\u0631 HTTPRequest\" class=\"wp-image-13009 lazyload\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2020\/11\/\u062f\u0631\u062e\u0648\u0627\u0633\u062a-\u0647\u0627-\u0648-\u067e\u0627\u0633\u062e-\u0647\u0627-\u062f\u0631-HTTPRequest.jpg 600w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2020\/11\/\u062f\u0631\u062e\u0648\u0627\u0633\u062a-\u0647\u0627-\u0648-\u067e\u0627\u0633\u062e-\u0647\u0627-\u062f\u0631-HTTPRequest-300x130.jpg.webp 300w\" data-sizes=\"(max-width: 600px) 100vw, 600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/260;\" \/><figcaption class=\"wp-element-caption\"><span style=\"font-size: 16px;\">\u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627 \u0648 \u067e\u0627\u0633\u062e \u0647\u0627 \u062f\u0631 HTTPRequest<\/span><\/figcaption><\/figure>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0647\u200c\u0637\u0648\u0631\u06a9\u0644\u06cc \u0628\u0647\u062a\u0631 \u0627\u0633\u062a \u062f\u0631 \u0645\u0648\u0627\u0642\u0639\u06cc \u06a9\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u067e\u06cc\u0686\u06cc\u062f\u0647\u200c\u062a\u0631\u06cc \u0645\u0648\u0631\u062f\u0646\u06cc\u0627\u0632 \u0628\u0627\u0634\u062f\u060c \u0627\u0632 axios \u0628\u0647 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0634\u062e\u0635 \u062b\u0627\u0644\u062b \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u062f\u0631 \u0645\u0648\u0631\u062f \u062a\u0648\u0633\u0639\u0647 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc \u0645\u062f\u0631\u0646\u060c \u0627\u0639\u0645 \u0627\u0632 \u0648\u0628\u060c \u0645\u0648\u0628\u0627\u06cc\u0644 \u06cc\u0627 \u0633\u0627\u06cc\u0631 \u0645\u0648\u0627\u0631\u062f\u060c \u062a\u0642\u0631\u06cc\u0628\u0627\u064b \u0647\u0645\u06cc\u0634\u0647 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u062a\u0639\u0627\u0645\u0644 \u0628\u0627 \u0633\u0631\u0648\u06cc\u0633\u200c\u0647\u0627\u06cc \u0648\u0628 \u0627\u0632 \u0631\u0627\u0647 \u062f\u0648\u0631\u060c \u0645\u0639\u0645\u0648\u0644\u0627\u064b \u0627\u0632 \u0637\u0631\u06cc\u0642 HTTP \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f. \u0647\u0646\u06af\u0627\u0645 \u06a9\u0627\u0631 \u0628\u0627 \u0686\u0627\u0631\u0686\u0648\u0628\u200c\u0647\u0627\u06cc\u06cc \u0645\u0627\u0646\u0646\u062f Angular \u060c Vue \u0648 React \u060c \u0639\u0645\u0644\u06a9\u0631\u062f\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u0628\u0631\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f\u060c \u0627\u0645\u0627 \u0627\u06af\u0631 \u0627\u0632 [&hellip;]<\/p>\n","protected":false},"author":84,"featured_media":13150,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,12],"tags":[],"class_list":["post-13005","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-and-it-training","category-java-script-articles"],"_links":{"self":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts\/13005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/users\/84"}],"replies":[{"embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/comments?post=13005"}],"version-history":[{"count":8,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts\/13005\/revisions"}],"predecessor-version":[{"id":67053,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts\/13005\/revisions\/67053"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/media\/13150"}],"wp:attachment":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/media?parent=13005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/categories?post=13005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/tags?post=13005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}