<?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>PHP</anon>
  </categories>
  <description>URLを指定してGETでデータが返ってくるようなWebAPIを叩くのにfile_get_contents()を使ってみました。(もっと良い方法があれば教えて下さい。) で、APIからデータは取得できたのですが、例えばAPI叩きすぎとかでAPIからエラーを返されることがあります。 その際に、そのままだとWarningが表示されてしまい、その後の処理でエラーになってしまったりするのでエラーハンドリングをしたいと思います。 $http_response_headerでレスポンスのステータスコードをチェックして判別する file_get_contents () で HTTP ラッパーを使うと $htt…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchaika.hatenablog.com%2Fentry%2F2016%2F03%2F23%2F083000&quot; title=&quot;PHP file_get_contents()でAPIを叩いた時のエラーハンドリングしたい - かもメモ&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>http://ecx.images-amazon.com/images/I/61nIP0+hVoL.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-03-23 08:30:00</published>
  <title>PHP file_get_contents()でAPIを叩いた時のエラーハンドリングしたい</title>
  <type>rich</type>
  <url>https://chaika.hatenablog.com/entry/2016/03/23/083000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
