{"id":57617,"date":"2018-03-04T09:02:45","date_gmt":"2018-03-04T00:02:45","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=57617"},"modified":"2018-03-04T09:02:45","modified_gmt":"2018-03-04T00:02:45","slug":"httpbin","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/httpbin\/","title":{"rendered":"httpbin - HTTP\u901a\u4fe1\u306e\u30c6\u30b9\u30c8\u306b\u4fbf\u5229\u306aWeb\u30b5\u30fc\u30d3\u30b9\uff06\u30bd\u30d5\u30c8"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2018\/03\/Is_20180302_210355.jpg\" alt=\"S 20180302 210355\" title=\"s_20180302_210355.jpg\" border=\"0\" width=\"910\" height=\"548\" \/><\/p>\n<p>Web\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u958b\u767a\u3067\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u304c\u3069\u306e\u3088\u3046\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u9001\u4fe1\u3057\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u3069\u306e\u3088\u3046\u306a\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8fd4\u3057\u3066\u3044\u308b\u306e\u304b\u6b63\u78ba\u306b\u7406\u89e3\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u8a73\u7d30\u3059\u308b\u300c<a href=\"http:\/\/httpbin.org\/\">httpbin<\/a>\u300d\u306f\u3053\u306e\u3088\u3046\u306aHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u78ba\u8a8d\u306b\u4fbf\u5229\u306aWeb\u30b5\u30fc\u30d3\u30b9&\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002Python\u88fd\u306e\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3001\u30ed\u30fc\u30ab\u30eb\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u57fa\u672c\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u5229\u7528\u3059\u308b\u306e\u304c\u7c21\u5358\u3067\u3059\u3002<\/p>\n<ul>\n<li><a href=\"http:\/\/httpbin.org\" rel=\"nofollow\">http:\/\/httpbin.org<\/a><\/li>\n<li><a href=\"https:\/\/httpbin.org\" rel=\"nofollow\">https:\/\/httpbin.org<\/a><\/li>\n<li><a href=\"http:\/\/eu.httpbin.org\" rel=\"nofollow\">http:\/\/eu.httpbin.org<\/a><\/li>\n<li><a href=\"https:\/\/eu.httpbin.org\" rel=\"nofollow\">https:\/\/eu.httpbin.org<\/a><\/li>\n<li><a href=\"https:\/\/hub.docker.com\/r\/kennethreitz\/httpbin\/\" rel=\"nofollow\">https:\/\/hub.docker.com\/r\/kennethreitz\/httpbin\/<\/a><\/li>\n<\/ul>\n<p>\u4e0a\u8a18URL\u306b\u5bfe\u3057\u3066\u3055\u307e\u3056\u307e\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u305fHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3059\u308b\u3068\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306eIP\u30a2\u30c9\u30ec\u30b9\u3084\u30e6\u30fc\u30b6\u30fc\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3001\u9001\u4fe1\u3055\u308c\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u306a\u3069\u3001\u3055\u307e\u3056\u307e\u306a\u60c5\u5831\u304cJSON\u30c7\u30fc\u30bf\u3068\u3057\u3066\u5e30\u3063\u3066\u304f\u308b\u306e\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u5177\u4f53\u7684\u306a\u4f7f\u7528\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>httpbin\u306e\u4f7f\u7528\u65b9\u6cd5<\/h2>\n<p>\u516c\u5f0f\u30b5\u30a4\u30c8\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u300ccurl\u300d\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6700\u3082\u308f\u304b\u308a\u3084\u3059\u3044ip\u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002URL\u306e\u672b\u5c3e\u306b<span class=\"mybold\">\/ip<\/span>\u3092\u7d50\u5408\u3057\u307e\u3059\u3002<\/p>\n<pre>\n$ curl http:\/\/httpbin.org\/ip\n{\"origin\": \"24.127.96.129\"}\n<\/pre>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30e6\u30fc\u30b6\u30fc\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408<span class=\"mybold\">\/useragent<\/span>\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre>\n$ curl http:\/\/httpbin.org\/user-agent\n{\"user-agent\": \"curl\/7.19.7 (universal-apple-darwin10.0) libcurl\/7.19.7 OpenSSL\/0.9.8l zlib\/1.2.3\"}\n<\/pre>\n<p>\u901a\u5e38\u306eGET\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u30c6\u30b9\u30c8\u3092\u884c\u3044\u305f\u3044\u5834\u5408<span class=\"mybold\">\/get<\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u6307\u5b9a\u53ef\u80fd\u3067\u3001\u623b\u308a\u5024\u306e\u4e2d\u306b\"args\"\u3068\u3057\u3066\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<pre>$ curl https:\/\/httpbin.org\/get?show_env=1\n{\n  \"headers\": {\n    \"Content-Length\": \"\",\n    \"Accept-Language\": \"en-US,en;q=0.8\",\n    \"Accept-Encoding\": \"gzip,deflate,sdch\",\n    \"X-Forwarded-Port\": \"443\",\n    \"X-Forwarded-For\": \"109.60.101.240\",\n    \"Host\": \"httpbin.org\",\n    \"Accept\": \"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8\",\n    \"User-Agent\": \"Mozilla\/5.0 (X11; Linux i686) AppleWebKit\/535.11 (KHTML, like Gecko) Chrome\/17.0.963.83 Safari\/535.11\",\n    \"X-Request-Start\": \"1350053933441\",\n    \"Accept-Charset\": \"ISO-8859-1,utf-8;q=0.7,*;q=0.3\",\n    \"Connection\": \"keep-alive\",\n    \"X-Forwarded-Proto\": \"https\",\n    \"Cookie\": \"_gauges_unique_day=1; _gauges_unique_month=1; _gauges_unique_year=1; _gauges_unique=1; _gauges_unique_hour=1\",\n    \"Content-Type\": \"\"\n  },\n  \"args\": {\n    \"show_env\": \"1\"\n  },\n  \"origin\": \"109.60.101.240\",\n  \"url\": \"http:\/\/httpbin.org\/get?show_env=1\"\n}\n<\/pre>\n<p>\u30ec\u30b9\u30dd\u30f3\u30b9\u306eHTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408<span class=\"mybold\">\/status\/:code<\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002curl\u306e\u5834\u5408\"-I\"\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u30ec\u30b9\u30dd\u30f3\u30b9\u30d8\u30c3\u30c0\u30fc\u3092\u8868\u793a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre>$ curl -I http:\/\/httpbin.org\/status\/418\nHTTP\/1.1 418 I'M A TEAPOT\nServer: nginx\/0.7.67\nDate: Mon, 13 Jun 2011 04:25:38 GMT\nConnection: close\nx-more-info: http:\/\/tools.ietf.org\/html\/rfc2324\nContent-Length: 135\n<\/pre>\n<p>URL\u306e\u672b\u5c3e\u306b<span class=\"mybold\">\/post<\/span>\u3092\u8ffd\u52a0\u3059\u308c\u3070\u30c7\u30fc\u30bf\u3092POST\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002curl\u306e\u5834\u5408\"-X POST -d \"foo=bar\"\u306e\u3088\u3046\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u623b\u308a\u5024\u306e\"form\"\u306e\u4e2d\u306bPOST\u3057\u305f\u30c7\u30fc\u30bf\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<pre>$ curl -X POST  -d \"foo=bar\" http:\/\/httpbin.org\/post\n{\n  \"args\": {},\n  \"data\": \"\",\n  \"files\": {},\n  \"form\": {\n    \"foo\": \"bar\"\n  },\n  \"headers\": {\n    \"Accept\": \"*\/*\",\n    \"Connection\": \"close\",\n    \"Content-Length\": \"7\",\n    \"Content-Type\": \"application\/x-www-form-urlencoded\",\n    \"Host\": \"httpbin.org\",\n    \"User-Agent\": \"curl\/7.54.0\"\n  },\n  \"json\": null,\n  \"origin\": \"109.60.101.240\",\n  \"url\": \"http:\/\/httpbin.org\/post\"\n}<\/pre>\n<p>\u305d\u306e\u4ed6<span class=\"mybold\">\/gzip<\/span>\u3067gzip\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u8fd4\u5374\u3059\u308b\u3088\u3046\u8981\u6c42\u3057\u305f\u308a\u3001\/delay:n\u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u9045\u3089\u305b\u305f\u308a\u306a\u3069\u3001\u3055\u307e\u3056\u306a\u6a5f\u80fd\u304c\u5229\u7528\u53ef\u80fd\u3067\u3059\u3002\u8a73\u7d30\u306f\u516c\u5f0f\u30b5\u30a4\u30c8\u306e\u30c9\u30ad\u30e5\u30f3\u3068\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30ed\u30fc\u30ab\u30eb\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5834\u5408<\/h2>\n<p>\u6700\u521d\u306b\u8ff0\u3079\u305f\u901a\u308ahttpbin\u306f\u30c4\u30fc\u30eb\u3068\u3057\u3066\u3082\u63d0\u4f9b\u3055\u308c\u3066\u3044\u3066\u3001\u81ea\u5206\u306e\u597d\u307f\u306e\u30b5\u30a4\u30c8\u306b\u5c55\u958b\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u305d\u306e\u5834\u5408\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre>$ pip install httpbin\n$ gunicorn httpbin:app\n<\/pre>\n<p>\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u30c6\u30b9\u30c8\u3057\u305f\u3044\u5834\u5408\u306f\u3053\u306e\u65b9\u304c\u4fbf\u5229\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>httpbin\u3092\u5229\u7528\u3059\u308c\u3070\u901a\u5e38\u306f\u9762\u5012\u306aHTTP\u901a\u4fe1\u306e\u30c6\u30b9\u30c8\u3092\u52b9\u7387\u3088\u304f\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306f\u7279\u306bcurl\u306b\u9650\u5b9a\u3055\u308c\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001\u81ea\u5206\u597d\u307f\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u5229\u7528\u3059\u308c\u3070\u826f\u3044\u3067\u3057\u3087\u3046\u3002\u5f53\u7136\u306a\u304c\u3089GET\u7cfb\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306fWeb\u30d6\u30e9\u30a6\u30b6\u3092\u5229\u7528\u3057\u3066\u767a\u884c\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2018\/03\/Is_20180302_205812.jpg\" alt=\"S 20180302 205812\" title=\"s_20180302_205812.jpg\" border=\"0\" width=\"865\" height=\"374\" \/><\/p>\n<p>Web\u958b\u767a\u306e\u7528\u9014\u4ee5\u5916\u306b\u3082\u3001\u81ea\u5206\u306eIP\u30a2\u30c9\u30ec\u30b9\u3084\u30e6\u30fc\u30b6\u30fc\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u6587\u5b57\u5217\u3092\u77e5\u308a\u305f\u3044\u5834\u5408\u306b\u4fbf\u5229\u306b\u3082\u5229\u7528\u3067\u304d\u305d\u3046\u306a\u30b5\u30a4\u30c8\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u958b\u767a\u3067\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u304c\u3069\u306e\u3088\u3046\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u9001\u4fe1\u3057\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u3069\u306e\u3088\u3046\u306a\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8fd4\u3057\u3066\u3044\u308b\u306e\u304b\u6b63\u78ba\u306b\u7406\u89e3\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u4eca\u56de\u8a73\u7d30\u3059\u308b\u300chttpbin\u300d\u306f\u3053\u306e\u3088\u3046\u306aHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30ec\u30b9\u30dd [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":57642,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[3459],"tags":[2915],"class_list":["post-57617","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-review","tag-http"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/57617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=57617"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/57617\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/57642"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=57617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=57617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=57617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}