{"id":3009,"date":"2024-12-29T10:40:44","date_gmt":"2024-12-29T01:40:44","guid":{"rendered":"https:\/\/www.agile-software.site\/?p=3009"},"modified":"2024-12-29T10:40:44","modified_gmt":"2024-12-29T01:40:44","slug":"fetch-2","status":"publish","type":"post","link":"https:\/\/agile-software.net\/?p=3009","title":{"rendered":"fetch"},"content":{"rendered":"\n<p>node-fetch\u306e\u4ee3\u308f\u308a\u306b\u7d44\u307f\u8fbc\u307f\u306efetch\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u63a8\u5968\u3057\u3066\u3044\u308b\u7406\u7531\u3092\u6559\u3048\u3066<\/p>\n\n\n\n<p>\u6700\u8fd1\u3067\u306f\u3001Node.js\u304c\u7d44\u307f\u8fbc\u307f\u306e<code>fetch<\/code>\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001<code>node-fetch<\/code>\u306a\u3069\u306e\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002\u4ee5\u4e0b\u306f\u3001\u7d44\u307f\u8fbc\u307f\u306e<code>fetch<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u308b\u7406\u7531\u3067\u3059\uff1a<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>\u4e00\u8cab\u6027<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li><code>fetch<\/code>\u306f\u30d6\u30e9\u30a6\u30b6\u74b0\u5883\u3067\u5e83\u304f\u4f7f\u7528\u3055\u308c\u3066\u304a\u308a\u3001\u540c\u3058API\u3092Node.js\u3067\u3082\u5229\u7528\u3067\u304d\u308b\u305f\u3081\u3001\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3068\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u30b3\u30fc\u30c9\u306e\u4e00\u8cab\u6027\u304c\u4fdd\u305f\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u306e\u624b\u9593\u304c\u6e1b\u5c11<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u7d44\u307f\u8fbc\u307f\u306e<code>fetch<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u8ffd\u52a0\u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u4e0d\u8981\u306b\u306a\u308a\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3084\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30d1\u30c3\u30c1\u306e\u9069\u7528\u306b\u95a2\u3059\u308b\u624b\u9593\u304c\u6e1b\u5c11\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u5411\u4e0a<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u7d44\u307f\u8fbc\u307f\u306e\u6a5f\u80fd\u306f\u3001\u901a\u5e38\u3001\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3088\u308a\u3082\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u512a\u308c\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002Node.js\u306e\u5185\u90e8\u3067\u6700\u9069\u5316\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u9ad8\u901f\u306a\u52d5\u4f5c\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u6700\u65b0\u306e\u6a5f\u80fd\u3078\u306e\u30a2\u30af\u30bb\u30b9<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>Node.js\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u306b\u4f34\u3044\u3001\u6700\u65b0\u306e\u6a5f\u80fd\u3084\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6539\u5584\u3092\u8fc5\u901f\u306b\u5229\u7528\u3067\u304d\u308b\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u9045\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u30b3\u30fc\u30c9\u306e\u7c21\u6f54\u5316<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u7d44\u307f\u8fbc\u307f\u306e<code>fetch<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u304c\u30b7\u30f3\u30d7\u30eb\u306b\u306a\u308a\u3001\u8aad\u307f\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002\u8ffd\u52a0\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u3084\u8a2d\u5b9a\u304c\u4e0d\u8981\u3067\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f8b<\/h3>\n\n\n\n<p>\u5f93\u6765\u306e<code>node-fetch<\/code>\u3092\u4f7f\u7528\u3057\u305f\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>const fetch = require(&#39;node-fetch&#39;);\n\nfetch(&#39;https:\/\/api.example.com\/data&#39;)\n  .then(response =&gt; response.json())\n  .then(data =&gt; console.log(data));<\/code><\/pre><\/div>\n\n\n\n<p>\u7d44\u307f\u8fbc\u307f\u306e<code>fetch<\/code>\u3092\u4f7f\u7528\u3057\u305f\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>fetch(&#39;https:\/\/api.example.com\/data&#39;)\n  .then(response =&gt; response.json())\n  .then(data =&gt; console.log(data));<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u7d44\u307f\u8fbc\u307f\u306e<code>fetch<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u304c\u7c21\u6f54\u306b\u306a\u308a\u3001\u8ffd\u52a0\u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u4e0d\u8981\u306b\u306a\u308b\u305f\u3081\u3001\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\nhttps:\/\/www.agile-software.site\/?p=3010\n","protected":false},"excerpt":{"rendered":"<p>node-fetch\u306e\u4ee3\u308f\u308a\u306b\u7d44\u307f\u8fbc\u307f\u306efetch\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u63a8\u5968\u3057\u3066\u3044\u308b\u7406\u7531\u3092\u6559\u3048\u3066 \u6700\u8fd1\u3067\u306f\u3001Node.js\u304c\u7d44\u307f\u8fbc\u307f\u306efetch\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001node-fetch\u306a\u3069\u306e\u5916\u90e8\u30e9\u30a4\u30d6\u30e9<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3009","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/3009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3009"}],"version-history":[{"count":1,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/3009\/revisions"}],"predecessor-version":[{"id":3012,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/3009\/revisions\/3012"}],"wp:attachment":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}