{"id":57789,"date":"2018-03-10T08:25:45","date_gmt":"2018-03-09T23:25:45","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=57789"},"modified":"2018-03-10T08:25:45","modified_gmt":"2018-03-09T23:25:45","slug":"httpie","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/httpie\/","title":{"rendered":"httpie - curl\u3088\u308a\u3082\u76f4\u611f\u7684\u306b\u5229\u7528\u306b\u4f7f\u7528\u3067\u304d\u308bHTTP\u30af\u30e9\u30a4\u30a2\u30f3\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_20180307_202757.jpg\" alt=\"S 20180307 202757\" title=\"s_20180307_202757.jpg\" border=\"0\" width=\"889\" height=\"612\" \/><\/p>\n<p>curl\u3084wget\u306a\u3069\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u5229\u7528\u3067\u304d\u308b\u6709\u540d\u306aHTTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u3044\u304f\u3064\u304b\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u7d39\u4ecb\u3059\u308b\u300c<a href=\"https:\/\/httpie.org\/\">HTTPie<\/a>\u300d\u3082\u305d\u306e\u3088\u3046\u306a\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u8d77\u52d5\u3059\u308b\u30bf\u30a4\u30d7\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3HTTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u4e00\u7a2e\u3067\u3059\u3002curl\u3084wget\u304c\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u4f7f\u7528\u3059\u308b\u30c4\u30fc\u30eb\u306a\u306e\u306b\u5bfe\u3057\u3001HTTPie\u306fPython\u88fd\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u306a\u3063\u3066\u3044\u308b\u70b9\u304c\u5927\u304d\u304f\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u306b\u306fPython\u74b0\u5883\u304c\u5fc5\u9808\u3068\u306a\u308a\u307e\u3059\u304c\u3001\u304b\u308f\u308a\u306b\u76f4\u611f\u7684\u306b\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u8a18\u6cd5\u304c\u8c4a\u5bcc\u3067\u3001\u4ed6\u306e\u30c4\u30fc\u30eb\u306b\u306f\u306a\u3044\u5de5\u592b\u304c\u51dd\u3089\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u7279\u5fb4\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u59a5\u5f53\u306a\u30c7\u30d5\u30a9\u30eb\u30c8<\/li>\n<li>\u8868\u73fe\u529b\u8c4a\u304b\u3067\u76f4\u611f\u7684\u306a\u30b3\u30de\u30f3\u30c9\u30b7\u30f3\u30bf\u30c3\u30af\u30b9<\/li>\n<li>\u8272\u3065\u3051\u3055\u308c\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3055\u308c\u305f\u51fa\u529b<\/li>\n<li>\u30d3\u30eb\u30c8\u30a4\u30f3JSON\u30b5\u30dd\u30fc\u30c8<\/li>\n<li>\u6c38\u7d9a\u7684\u306a\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u30b5\u30dd\u30fc\u30c8<\/li>\n<li>\u30d5\u30a9\u30fc\u30e0\u3068\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9<\/li>\n<li>HTTPS\u3001\u30d7\u30ed\u30ad\u30b7\u3001\u8a8d\u8a3c\u30b5\u30dd\u30fc\u30c8<\/li>\n<li>\u4efb\u610f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u30c7\u30fc\u30bf\u3001\u30d8\u30c3\u30c0\u30fc\u306e\u30b5\u30dd\u30fc\u30c8<\/li>\n<li>wget\u98a8\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/li>\n<li>\u62e1\u5f35<\/li>\n<li>Linux\u3001macOS\u3001Windows\u306e\u30b5\u30dd\u30fc\u30c8<\/li>\n<li><a href=\"https:\/\/httpie.org\/doc\">\u305d\u306e\u4ed6\u3044\u308d\u3044\u308d<\/a><\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u4f7f\u7528\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>httpie\u306e\u4f7f\u7528\u65b9\u6cd5<\/h2>\n<p>\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u5f93\u3063\u3066<a href=\"https:\/\/httpie.org\/doc#installation\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a>\u3057\u307e\u3059\u3002macOS\u306e\u5834\u5408Homebrew\u3084MacPorts\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u304c\u6700\u3082\u7c21\u5358\u3067\u3059\u3002<\/p>\n<p>Homebrew\u306e\u5834\u5408:<\/p>\n<pre>\nbrew install httpie\n<\/pre>\n<p>MacPorts\u306e\u5834\u5408:<\/p>\n<pre>\nport install httpie\n<\/pre>\n<p>Python\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3pip\u3092\u5229\u7528\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\npip install httpie\n<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308c\u3070\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u300chttp\u300d\u30b3\u30de\u30f3\u30c9\u304c\u5229\u7528\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002httpie\u306e\u30b3\u30de\u30f3\u30c9\u540d\u306f\u300chttpie\u300d\u3067\u306f\u306a\u304f\u300chttp\u300d\u306a\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u6cd5\u306f<a href=\"https:\/\/httpie.org\/doc#examples\">Examples<\/a>\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>GET\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3059\u308b\u5834\u5408URL\u3092\u5f15\u304d\u6570\u3068\u3057\u3066\u6e21\u3057\u307e\u3059\u3002<\/p>\n<pre>\nhttp httpie.org\n<\/pre>\n<p>URL\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u90e8\u5206\u304c\u7701\u7565\u3055\u308c\u308b\u3068\u300chttp:\/\/httpie.org\u300d\u3068\u307f\u306a\u3055\u308c\u307e\u3059\u3002https\u7248\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u3044\u5834\u5408\u306a\u3069\u901a\u5e38\u306eURL\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\nhttp https:\/\/httpie.org\n<\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306f\u5358\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308c\u3070OK\u3067\u3059\u3002httpie\u306f\u30bf\u30fc\u30df\u30ca\u30eb\u51fa\u529b\u3068\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u51fa\u529b\u3067\u7570\u306a\u308b\u51fa\u529b\u3092\u884c\u3046\u3088\u3046\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u5834\u5408\u30ec\u30b9\u30dd\u30f3\u30b9\u30dc\u30c7\u30a3\u3060\u3051\u304c\u51fa\u529b\u3055\u308c\u308b\u305f\u3081\u3001\u7c21\u5358\u306a\u66f8\u5f0f\u3067\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4fdd\u5b58\u3067\u304d\u308b\u306e\u3067\u3059\u3002<\/p>\n<pre>\nhttp example.org\/file > file\n<\/pre>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306b\u306fwget\u98a8\u306e\u30b9\u30bf\u30a4\u30eb\u3082\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\nhttp --download example.org\/file\n<\/pre>\n<p>\u30ed\u30fc\u30ab\u30eb\u30db\u30b9\u30c8\u306b\u5bfe\u3059\u308b\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u3082\u5229\u7528\u3067\u304d\u307e\u3059\u3002\u5c11\u306a\u3044\u30bf\u30a4\u30d7\u6570\u3067\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\n# GET http:\/\/localhost\/foo\nhttp :\/foo\n\n# GET http:\/\/localhost:3000\/bar\nhttp :3000\/bar\n\n# GET http:\/\/localhost\/\nhttp :\n<\/pre>\n<p>GET\u3084POST(\u30ea\u30af\u30a8\u30b9\u30c8\u30c7\u30fc\u30bf\u304c\u4ed8\u5c5e\u3057\u3066\u3044\u308b\u5834\u5408\u81ea\u52d5\u7684\u306bPOST\u3068\u5224\u5b9a\u3055\u308c\u307e\u3059)\u4ee5\u5916\u306eHTTP\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u300chttp \u30e1\u30bd\u30c3\u30c9 URL\u300d\u306e\u66f8\u5f0f\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>PUT\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u3001\u30d8\u30c3\u30c0\u3068\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3064\u304d\u3067\u9001\u4fe1\u3059\u308b\u5834\u5408\u3002<\/p>\n<pre>\nhttp PUT example.org X-API-Token:123 name=John\n<\/pre>\n<p>form\u3092\u30b5\u30d6\u30df\u30c3\u30c8\u3059\u308b\u5834\u5408\u3002<\/p>\n<pre>\nhttp -f POST example.org hello=World\n<\/pre>\n<p>DELETE\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3059\u308b\u5834\u5408\u3002<\/p>\n<pre>\nhttp DELETE example.org\/todos\/7\n<\/pre>\n<p>\u305d\u306e\u4ed6\u8a8d\u8a3c\u3084\u30d7\u30ed\u30ad\u30b7\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u5229\u7528\u3059\u308b\u65b9\u6cd5\u306a\u3069\u3001\u3088\u308a\u9ad8\u5ea6\u306a\u5185\u5bb9\u304c\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u306f\u63b2\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u4f7f\u7528\u3059\u308b\u524d\u306b\u76ee\u3092\u901a\u3057\u3066\u304a\u304f\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\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_20180307_202814.jpg\" alt=\"S 20180307 202814\" title=\"s_20180307_202814.jpg\" border=\"0\" width=\"845\" height=\"571\" \/><\/p>\n<p>\u25b2\u4ee5\u524d\u7d39\u4ecb\u3057\u305f\u3001\u3055\u307e\u3056\u307e\u306aHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u300c<a href=\"https:\/\/softantenna.com\/blog\/review\/httpbin\/\">httpbin<\/a>\u300d\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u6a5f\u80fd\u306e\u78ba\u8a8d\u304c\u7c21\u5358\u306b\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>httpie\u306fPython\u88fd\u306e\u30c4\u30fc\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u5b9f\u884c\u6642\u306bPython\u74b0\u5883\u304c\u5fc5\u8981\u306b\u306a\u308b\u3068\u3044\u3046\u30c7\u30e1\u30ea\u30c3\u30c8\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u305d\u306e\u53cd\u9762\u30b3\u30de\u30f3\u30c9\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u306fcurl\u3084wget\u3068\u6bd4\u8f03\u3059\u308b\u3068\u30b7\u30f3\u30d7\u30eb\u3067\u3001\u4eba\u9593\u304c\u4f7f\u3044\u3084\u3059\u3044\u3088\u3046\u306b\u5de5\u592b\u3055\u308c\u3066\u3044\u308b\u5370\u8c61\u304c\u3042\u308a\u307e\u3059\u3002\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3092\u5229\u7528\u3057\u3066http\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u9001\u53d7\u4fe1\u3092\u5b9f\u884c\u3057\u305f\u3044\u65b9\u306f\u8a66\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>curl\u3084wget\u306a\u3069\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u5229\u7528\u3067\u304d\u308b\u6709\u540d\u306aHTTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u3044\u304f\u3064\u304b\u5b58\u5728\u3057\u307e\u3059\u3002 \u4eca\u56de\u7d39\u4ecb\u3059\u308b\u300cHTTPie\u300d\u3082\u305d\u306e\u3088\u3046\u306a\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u8d77\u52d5\u3059\u308b\u30bf\u30a4\u30d7\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3HTTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u4e00\u7a2e\u3067\u3059\u3002cu [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":57839,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[3459],"tags":[2915],"class_list":["post-57789","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\/57789","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=57789"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/57789\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/57839"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=57789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=57789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=57789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}