<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kikiki-kiki</author_name>
  <author_url>https://blog.hatena.ne.jp/kikiki-kiki/</author_url>
  <blog_title>かもメモ</blog_title>
  <blog_url>https://chaika.hatenablog.com/</blog_url>
  <categories>
    <anon>JavaScript</anon>
    <anon>TypeScript</anon>
    <anon>Next.js</anon>
    <anon>非同期処理</anon>
    <anon>fetch</anon>
    <anon>Ajax</anon>
  </categories>
  <description>Next.js の api を使って非同期処理のモックを作っていて Fetch API だとステータスコードが 200 系以外でもエラーが発生しないみたいだったのでステータスコードでエラーハンドリングできるようにしたメモ 環境 node.js v18.14.0 Next.js 13.2.4 React 18.2.0 TypeScript 5.0.2 API (Next.js) Next.js でシンプルな API を作成 POST 以外の場合は 405 (Method Not Allowed) を返す 認証が通らなかったら 400 (Bad Request) を返す 認証が通ったら 200 で…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchaika.hatenablog.com%2Fentry%2F2023%2F03%2F27%2F083000&quot; title=&quot;JavaScript Fetch でステータスコードを使ってエラーハンドリングしたい - かもメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://m.media-amazon.com/images/I/51LUFnu+5yL._SL500_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-03-27 08:30:00</published>
  <title>JavaScript Fetch でステータスコードを使ってエラーハンドリングしたい</title>
  <type>rich</type>
  <url>https://chaika.hatenablog.com/entry/2023/03/27/083000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
