<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tanakahisateru</author_name>
  <author_url>https://blog.hatena.ne.jp/tanakahisateru/</author_url>
  <blog_title>なんたらノート第三期ベータ</blog_title>
  <blog_url>https://tanakahisateru.hatenablog.jp/</blog_url>
  <categories>
    <anon>PHP</anon>
  </categories>
  <description>PHPでサーバ-サーバ間でREST-APIを使うとき、file_get_contentsを使うのが簡単なんですが、エラーレスポンスの場合、その状況をどう解釈したらいいのかという説明がどうもあいまいな気がしたので、ちょっと調べてみました。レスポンスコード200とエラー、それと、タイムアウトを判別する方法は、どうやらこんな感じみたいです。 &lt;?php $data = @file_get_contents('http://hostname/resouce', false, stream_context_create(array( 'http' =&gt; array( 'timeout'=&gt;10 // 早…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftanakahisateru.hatenablog.jp%2Fentry%2F20110224%2F1298533876&quot; title=&quot;PHPでfile_get_contents使ったHTTP接続がエラーなのかタイムアウトなのかを判別する - なんたらノート第三期ベータ&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2011-02-24 16:51:16</published>
  <title>PHPでfile_get_contents使ったHTTP接続がエラーなのかタイムアウトなのかを判別する</title>
  <type>rich</type>
  <url>https://tanakahisateru.hatenablog.jp/entry/20110224/1298533876</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
