{"id":6033,"date":"2020-03-05T18:30:19","date_gmt":"2020-03-05T09:30:19","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=6033"},"modified":"2020-03-06T04:00:04","modified_gmt":"2020-03-05T19:00:04","slug":"laravel-7-x%e3%81%ae%e6%96%b0%e3%81%97%e3%81%84http-client%ef%bc%81%e5%ae%9f%e4%be%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=6033","title":{"rendered":"Laravel 7.x\u306e\u65b0\u3057\u3044HTTP Client\uff01\u5b9f\u4f8b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u8a18\u4e8b <a href=\"https:\/\/blog.capilano-fw.com\/?p=6020\">Laravel 7.x\u306e\u65b0\u30eb\u30fc\u30c8\u6a5f\u80fd<\/a> \u3067\u306f\u3001<code>Laravel<\/code>\u306e\u65b0\u3057\u3044\u30eb\u30fc\u30c8\u6a5f\u80fd\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u4eca\u56de\u3082\u3053\u306e\u6d41\u308c\u3067\u4fbf\u5229\u306a\u300c\u3042\u308b\u6a5f\u80fd\u300d\u3092\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u6a5f\u80fd\u3068\u306f\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">HTTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u6a5f\u80fd<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001<code>Laravel<\/code>\uff08PHP\uff09\u304b\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306e\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u306bHTTP\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u6a5f\u80fd\u3067\u3059\u306d\u3002<\/p>\n<p>\u305f\u3060\u3001\u3082\u3057\u304b\u3059\u308b\u3068<\/p>\n<p><strong style=\"font-size: 35px;\">\u300cPHP \u3067 HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u306a\u3089Guzzle\u304c\u3042\u308b\u3058\u3083\u3093\u30fb\u30fb\u30fb\u300d<\/strong><\/p>\n<p>\u3068\u601d\u308f\u308c\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u5148\u306b\u8a00\u3063\u3066\u304a\u304d\u307e\u3059\u3068\u3001\u4eca\u56de\u306e\u65b0\u3057\u3044HTTP\u6a5f\u80fd\u306f<strong>\u5185\u90e8\u7684\u306b\u300cGuzzle\u300d\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/strong><span style=\"font-size: 1rem;\">\u3067\u3082<\/span>\u3001\u3069\u3046\u3084\u3089\u3088\u304f\u4f7f\u3046\u90e8\u5206\u306f<code>Laravel<\/code>\u5074\u3067\u7c21\u5358\u306b\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3088\u3046\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u3063\u305f\u3088\u3046\u3067\u3059\u3002\uff08\u3064\u307e\u308a\u30e9\u30c3\u30d1\u30fc\u30af\u30e9\u30b9\u3067\u3059\u306d\uff09<\/p>\n<p>\u305d\u3053\u3067\uff01<\/p>\n<p>\u4eca\u56de\u306f<code>Laravel 7.x<\/code>\u306e\u65b0\u6a5f\u80fd\u306e<code>HTTP Client<\/code>\u306e\u4f7f\u3044\u65b9\u3092\u5b9f\u4f8b\u3067\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 7.x<\/p>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h1>\n<p>\u4eca\u56de\u5fc5\u8981\u3068\u306a\u308b\u306e\u306f<code>Guzzle<\/code>\u3067\u3059\u304c\u3001<strong>\u3059\u3067\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<\/strong><br \/>\n\u3082\u3057\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u306a\u3044\u3088\u3046\u3067\u3057\u305f\u3089\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>composer require guzzlehttp\/guzzle:^6.3<\/strong><\/pre>\n<h1>\u4f7f\u3044\u65b9\u3092\u7d39\u4ecb\u3059\u308b\u524d\u306b<\/h1>\n<p>\u4eca\u56de\u3001<code>HTTP Client<\/code>\u3067\u30a2\u30af\u30bb\u30b9\u30fb\u30c6\u30b9\u30c8\u3092\u3059\u308b\u308f\u3051\u3067\u3059\u304c\u3001\u3044\u3061\u3044\u3061\u81ea\u524d\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30da\u30fc\u30b8\u3092\u4f5c\u308b\u306e\u306f\u3081\u3093\u3069\u3046\u3067\u3059\u306e\u3067\u3001<a href=\"https:\/\/jsonplaceholder.typicode.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">JSONPlaceholder<\/a>\u3068\u3044\u3046\u30b5\u30a4\u30c8\u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30b5\u30a4\u30c8\u306f\u3001<code>GET<\/code>\u3084<code>POST<\/code>\u3001<code>PUT<\/code>\u3001<code>PATCH<\/code>\u3001<code>DELETE<\/code>\u306a\u3069\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b<code>URL<\/code>\u3092\u7528\u610f\u3057\u3066\u304f\u308c\u3066\u3044\u3066\u3001\u30c6\u30b9\u30c8\u306b\u306f\u3068\u3066\u3082\u91cd\u5b9d\u3057\u307e\u3059\u3002\uff08\u7121\u6599\u3067\u3059\uff09<\/p>\n<p>\u307e\u305f\u3001HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\u304c\u95a2\u9023\u3059\u308b\u30c6\u30b9\u30c8\u306b\u306f\u3001<a href=\"http:\/\/httpstat.us\" target=\"_blank\" rel=\"noopener noreferrer\">httpstat.us<\/a>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h1>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h1>\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3092\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u304c\u3001\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u306f\u7701\u7565\u3057\u307e\u3059\u306e\u3067\u3001\u5148\u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3084\u30eb\u30fc\u30c8\u306b\u8ffd\u52a0\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>use \\Illuminate\\Support\\Facades\\Http;\r\n<\/strong><\/pre>\n<h2>\u30d1\u30e9\u30e1\u30fc\u30bf\u306a\u3057\u3067\u9001\u4fe1\u3059\u308b\u5834\u5408<\/h2>\n<p>\u307e\u305a\u306f\u30d1\u30e9\u30e1\u30fc\u30bf\u306a\u3057\u3067\u9001\u4fe1\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre>\/\/ GET\r\n$response = <strong>Http::get('https:\/\/jsonplaceholder.typicode.com\/posts\/1')<\/strong>;\r\n\r\n\/\/ POST\r\n$response = <strong>Http::post('https:\/\/jsonplaceholder.typicode.com\/posts')<\/strong>;\r\n\r\n\/\/ PUT\r\n$response = <strong>Http::put('https:\/\/jsonplaceholder.typicode.com\/posts\/1')<\/strong>;\r\n\r\n\/\/ PATCH\r\n$response = <strong>Http::patch('https:\/\/jsonplaceholder.typicode.com\/posts\/1')<\/strong>;\r\n\r\n\/\/ DELETE\r\n$response = <strong>Http::delete('https:\/\/jsonplaceholder.typicode.com\/posts\/1')<\/strong>;<\/pre>\n<p>\u203b\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u51e6\u7406\u306b\u3064\u3044\u3066\u306f<a href=\"#response\">\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u51e6\u7406\u3059\u308b<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u3064\u3051\u308b\u5834\u5408<\/h2>\n<p>\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u3064\u3051\u3066\u9001\u4fe1\u3059\u308b\u5834\u5408\u306f\u3001\u7b2c\uff12\u5f15\u6570\u306b\u914d\u5217\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre>$response = Http::post($url, <strong>[<\/strong>\r\n<strong>    'key_1' =&gt; 'value - 1',<\/strong>\r\n<strong>    'key_2' =&gt; 'value - 2',<\/strong>\r\n<strong>    'key_3' =&gt; 'value - 3',<\/strong>\r\n<strong>]<\/strong>);<\/pre>\n<p>\u203b\u3082\u3061\u308d\u3093\u3001<code>POST<\/code>\u4ee5\u5916\u3067\u3082\u3053\u306e\u5f62\u3067\u30d1\u30e9\u30e1\u30fc\u30bf\u9001\u4fe1\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u9001\u4fe1\u306f\u521d\u671f\u72b6\u614b\u3067\u306f<code>application\/json<\/code>\u3068\u3057\u3066\u9001\u4fe1\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u5b9f\u969b\u306e\u30d5\u30a9\u30fc\u30e0\u9001\u4fe1\u306e\u3088\u3046\u306b\u3059\u308b\u5834\u5408\u306f<code>asForm()<\/code>\u3068\u4e00\u7dd2\u306b\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>$response = Http::<strong>asForm()<\/strong>-&gt;post($url, [\r\n    'key_1' =&gt; 'value - 1',\r\n    'key_2' =&gt; 'value - 2',\r\n    'key_3' =&gt; 'value - 3',\r\n]);<\/pre>\n<div id=\"response\"><\/div>\n<h1>\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u51e6\u7406\u3059\u308b<\/h1>\n<h2>\u30ec\u30b9\u30dd\u30f3\u30b9Body\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u30ec\u30b9\u30dd\u30f3\u30b9Body\uff08\u30d6\u30e9\u30a6\u30b6\u3067\u8868\u793a\u3055\u308c\u308b\u90e8\u5206\uff09\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>echo <strong>$response-&gt;body()<\/strong>;<\/pre>\n<h2>JSON\u3092\u30d1\u30fc\u30b9\uff08\u914d\u5217\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5316\uff09\u3059\u308b<\/h2>\n<p>\u30ec\u30b9\u30dd\u30f3\u30b9Body\u304c<code>JSON<\/code>\u5f62\u5f0f\u306e\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$data = <strong>$response-&gt;json()<\/strong>;<\/pre>\n<p>\u203b\u3082\u3057<code>Body<\/code>\u306e\u30c7\u30fc\u30bf\u304c<code>JSON<\/code>\u3067\u306f\u306a\u3044\u5834\u5408\u306f<code>null<\/code>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001<code>$response<\/code>\u306f<code>ArrayAccess interface<\/code>\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u306e\u3067\u3001<code>json()<\/code>\u3092\u4f7f\u308f\u306a\u304f\u3068\u3082\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u76f4\u63a5\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>echo <strong>$response['title']<\/strong>;<\/pre>\n<h2>\u30d8\u30c3\u30c0\u30fc\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<h3>\u5168\u3066\u306e\u30d8\u30c3\u30c0\u30fc\u3092\u53d6\u5f97\u3059\u308b<\/h3>\n<p>\u4e00\u6c17\u306b\u5168\u3066\u306e\u30d8\u30c3\u30c0\u30fc\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>$headers = <strong>$response-&gt;headers()<\/strong>;<\/pre>\n<h3>\u7279\u5b9a\u306e\u30d8\u30c3\u30c0\u30fc\u3060\u3051\u53d6\u5f97\u3059\u308b<\/h3>\n<p>\u7279\u5b9a\u306e\u30d8\u30c3\u30c0\u30fc\u3060\u3051\u53d6\u5f97\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>$content_type = <strong>$response-&gt;header('Content-Type')<\/strong>;<\/pre>\n<h2>HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<pre>$status_code = <strong>$response-&gt;status()<\/strong>; \/\/ 200\u306a\u3069<\/pre>\n<h2>\u30a2\u30af\u30bb\u30b9\u3057\u305fURL\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001<code>scheme<\/code>\u3084\u3001<code>host<\/code>\u306a\u3069\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6034\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/laravel_new_http_client_1.png\" alt=\"\" width=\"240\" height=\"125\" \/><\/p>\n<pre>$url_info = <strong>$response-&gt;effectiveUri()<\/strong>;<\/pre>\n<h2>\u30af\u30c3\u30ad\u30fc\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u30af\u30c3\u30ad\u30fc\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u306f\u5c11\u3057\u3060\u3051\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n\u3068\u3044\u3046\u306e\u3082\u3001<code>cookies()<\/code>\u3067\u53d6\u5f97\u3067\u304d\u308b\u306e\u306f<code>Guzzle<\/code>\u304c\u63d0\u4f9b\u3059\u308b<code>CookieJar<\/code>\u3068\u3044\u3046\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306a\u306e\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<pre>$response = Http::get($url);\r\n$cookies = <strong>$response-&gt;cookies();<\/strong> \/\/ GuzzleHttp\\Cookie\\CookieJar\r\necho $cookies-&gt;getCookieByName('key')-&gt;getValue();<\/pre>\n<p>\u203b<code>Laravel<\/code>\u306e\u30b3\u30fc\u30c9\u3092\u898b\u308b\u9650\u308a<code>cookies()<\/code>\u306e\u8aac\u660e\u66f8\u304d\u306b<code>@return array<\/code>\u3068\u66f8\u3044\u3066\u3042\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u3082\u3057\u304b\u3059\u308b\u3068\u3061\u3087\u3063\u3068\u3057\u305f\u8868\u8a18\u30df\u30b9\u306e\u53ef\u80fd\u6027\u3082\u3042\u308a\u307e\u3059\u3002\uff082020.03.04\u73fe\u5728\uff09<\/p>\n<h2>PSR-7\u5f62\u5f0f\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u5909\u63db\u3059\u308b<\/h2>\n<pre>$psr_response = <strong>$response-&gt;toPsrResponse()<\/strong>;<\/pre>\n<h2>\u4f8b\u5916\u51e6\u7406\u3092\u3059\u308b<\/h2>\n<p>\u3082\u3057\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\u304c400\u756a\u53f0\u3001\u3082\u3057\u304f\u306f500\u756a\u53f0\u306e\u3068\u304d\u306b\u4f8b\u5916\u51e6\u7406\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u304c<code>throw()<\/code>\u3067\u3059\u3002<\/p>\n<p>\u4f7f\u3044\u65b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$url = 'https:\/\/httpstat.us\/404';\r\n$response = Http::get($url);\r\n\r\n<strong>$response-&gt;throw()<\/strong>;<\/pre>\n<p>\u3053\u306e\u5834\u5408\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\u306f<code>404<\/code>\u306a\u306e\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6035\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/laravel_new_http_client_2.png\" alt=\"\" width=\"480\" height=\"111\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/laravel_new_http_client_2.png 480w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/laravel_new_http_client_2-300x69.png 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<h1>\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u7d50\u679c\u3092\u5224\u5225\u3059\u308b<\/h1>\n<p>HTTP\u3067\u30a2\u30af\u30bb\u30b9\u3057\u305f\u7d50\u679c\u304c\u3069\u306e\u3088\u3046\u306a\u3082\u306e\u3060\u3063\u305f\u304b\u3092<code>true<\/code> \/ <code>false<\/code>\u3067\u8fd4\u3057\u3066\u304f\u308c\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u4e00\u89a7\u3067\u3059\u3002<\/p>\n<p>\u5168\u3066HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\u3067\u5224\u5225\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\u304c200<\/h2>\n<pre>if(<strong>$response-&gt;ok()<\/strong>) {\r\n  \/\/ \u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\uff1a 200\r\n}<\/pre>\n<h2>\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\u304c 200\u756a\u53f0<\/h2>\n<pre>if(<strong>$response-&gt;successful()<\/strong>) {\r\n    \/\/ \u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\uff1a 200\u301c299\r\n}<\/pre>\n<h2>\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\u304c 300\u756a\u53f0<\/h2>\n<pre>if(<strong>$response-&gt;redirect()<\/strong>) {\r\n    \/\/ \u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\uff1a 300\u301c399\r\n}<\/pre>\n<h2>\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\u304c 400\u756a\u53f0<\/h2>\n<pre>if(<strong>$response-&gt;clientError()<\/strong>) {\r\n    \/\/ \u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\uff1a 400\u301c499\r\n}<\/pre>\n<h2>\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\u304c 500\u756a\u53f0<\/h2>\n<pre>if(<strong>$response-&gt;serverError()<\/strong>) {\r\n    \/\/ \u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\uff1a 500\u301c599\r\n}<\/pre>\n<h1>\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b<\/h1>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u5834\u5408\u306f<code>attach()<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>$name = 'image';\r\n$content = file_get_contents('images\/test.jpg');\r\n$filename = 'image.jpg';    \/\/ \u7701\u7565\u53ef\r\n$url = 'http:\/\/example.test\/file_upload';\r\n\r\n$response = <strong>Http::attach($name, $content, $filename)<\/strong>-&gt;post($url);<\/pre>\n<p>\u306a\u304a\u3001\u30d5\u30a1\u30a4\u30eb\u3068\u4e00\u7dd2\u306b\u901a\u5e38\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u9001\u4fe1\u3059\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u306f<strong>\u3067\u304d\u307e\u305b\u3093\u3002<\/strong><\/p>\n<pre><strong>\/\/ \u26a0\ufe0f\u3010\u6ce8\u610f\u3011\u3053\u308c\u306f\u9593\u9055\u3063\u305f\u4f8b\u3067\u3059\uff01\r\n<\/strong>\r\n$response = Http::attach($name, $content, $filename)\r\n    -&gt;post($url, <strong>[<\/strong>\r\n<strong>        'key' =&gt; 'value' <\/strong>\/\/ \u901a\u5e38\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u6307\u5b9a\u65b9\u6cd5\u306f\u30a8\u30e9\u30fc\u306b\u306a\u308b\r\n<strong>    ]<\/strong>);<\/pre>\n<p>\u305d\u306e\u5834\u5408\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u6307\u5b9a\u3068\u540c\u3058\u3088\u3046\u306b\u7e70\u308a\u8fd4\u3057<code>attach()<\/code>\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>$response = Http::attach($name, $content, $filename)\r\n    <strong>-&gt;attach('key', 'value') <\/strong>\/\/ \u901a\u5e38\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\r\n    -&gt;post($url);<\/pre>\n<h1>\u30d8\u30c3\u30c0\u30fc\u3092\u6307\u5b9a\u3059\u308b<\/h1>\n<p>\u30d8\u30c3\u30c0\u30fc\u3092\u6307\u5b9a\u3059\u308b\u306b\u306f<code>withHeaders()<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>$response = Http::<strong>withHeaders([<\/strong>\r\n<strong>    'X-Program' =&gt; 'Work',<\/strong>\r\n<strong>    'X-Piano' =&gt; 'Life',<\/strong>\r\n<strong>    'X-Beer' =&gt; 'Energy'<\/strong>\r\n<strong>])<\/strong>-&gt;get($url);<\/pre>\n<h1>\u8a8d\u8a3c\u60c5\u5831\u3092\u8ffd\u52a0\u3059\u308b<\/h1>\n<h2>\u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c<\/h2>\n<pre>$username = 'taro@example.com';\r\n$password = 'secret';\r\n$response = Http::<strong>withBasicAuth($username, $password)<\/strong>-&gt;get($url);<\/pre>\n<p>\u306a\u304a\u3001<code>Laravel<\/code>\u306b\u306f\u7c21\u5358\u306b\u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c\u3092\u6709\u52b9\u306b\u3059\u308b\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre>Route::get('basic_auth', function(){\r\n\r\n    return 'OK!';\r\n\r\n})-&gt;<strong>middleware('auth.basic')<\/strong>;<\/pre>\n<p>\u3053\u306e\u5834\u5408\u3001<code>users<\/code>\u30c6\u30fc\u30d6\u30eb\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306e<code>email<\/code>\u3068<code>password<\/code>\u3067\u30a2\u30af\u30bb\u30b9\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30c0\u30a4\u30b8\u30a7\u30b9\u30c8\u8a8d\u8a3c<\/h2>\n<pre>$username = 'taro@example.com';\r\n$password = 'secret';\r\n$response = Http::<strong>withDigestAuth($username, $password)<\/strong>-&gt;get($url);<\/pre>\n<h2>Bearer\u30c8\u30fc\u30af\u30f3<\/h2>\n<pre>$token = 'Your-Bearer-Token';\r\n$response = Http::<strong>withToken($token)<\/strong>-&gt;get($url);<\/pre>\n<h1>\u518d\u30a2\u30af\u30bb\u30b9<\/h1>\n<p><code>Http Client<\/code>\u306b\u306f\u30a2\u30af\u30bb\u30b9\u304c\u5931\u6557\u3057\u305f\u5834\u5408\u306b\u7e70\u308a\u8fd4\u3057\u30a2\u30af\u30bb\u30b9\u3092\u8a66\u307f\u308b<code>retries()<\/code>\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>$times = 3; \/\/ \u30a2\u30af\u30bb\u30b9\u3092\u8a66\u307f\u308b\u6700\u5927\u56de\u6570\r\n$sleep = 1000; \/\/ \u5f85\u6a5f\u3059\u308b\u30df\u30ea\u79d2\r\n$response = Http::<strong>retries($times, $sleep)<\/strong>-&gt;get($url);<\/pre>\n<h1>\u30c6\u30b9\u30c8\u6a5f\u80fd<\/h1>\n<p><code>Http Client<\/code>\u306b\u306f\u3001\u958b\u767a\u306e\u305f\u3081\u306e\u4fbf\u5229\u306a\u6a5f\u80fd\u3082\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u3001\u307e\u3060\u30b3\u30fc\u30c9\u304c\u3057\u3063\u304b\u308a\u56fa\u307e\u3063\u3066\u3044\u306a\u3044\u5834\u9762\u3067\u306f\u3001\u3053\u306e\u6a5f\u80fd\u3067<strong>\u5b9f\u969b\u306b\u306f\u30a2\u30af\u30bb\u30b9\u305b\u305a\u306b\u78ba\u8a8d\u3067\u304d\u307e\u3059<\/strong>\u306e\u3067\u3001\u30a2\u30af\u30bb\u30b9\u5148\u306b\u904e\u5ea6\u306e\u8ca0\u8377\u3092\u304b\u3051\u308b\u3053\u3068\u3082\u306a\u304f\u3001\u3082\u3061\u308d\u3093\u30d6\u30ed\u30c3\u30af\u3055\u308c\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h2>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001<code>your-site.test<\/code>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u8fd4\u308b\u3088\u3046\u306b\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u30ec\u30b9\u30dd\u30f3\u30b9Body\u3000\u30fb\u30fb\u30fb\u3000\u30c6\u30b9\u30c8\u6587\u5b57\u5217<\/li>\n<li>HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30b3\u30fc\u30c9\u3000\u30fb\u30fb\u30fb\u3000200<\/li>\n<li>\u30d8\u30c3\u30c0\u30fc\u3000\u30fb\u30fb\u30fb\u3000X-Example: Example Header<\/li>\n<\/ul>\n<pre>$body = '\u30c6\u30b9\u30c8\u6587\u5b57\u5217';   \/\/ \u914d\u5217\u306e\u5834\u5408\u306fJSON\u304c\u8fd4\u308a\u307e\u3059\r\n$status = 200;\r\n$headers = ['X-Example' =&gt; 'Example Header'];\r\nHttp::<strong>fake([<\/strong>\r\n<strong>    'your-site.test\/*' =&gt; Http::response($body, $status, $headers)<\/strong>\r\n<strong>])<\/strong>;\r\n\r\n\/\/ \u30c6\u30b9\u30c8\u3067HTTP\u30a2\u30af\u30bb\u30b9\r\n$response = Http::post('http:\/\/your-site.test\/test');<\/pre>\n<p>\u306a\u304a\u3001<code>fake()<\/code>\u306b\u306f\u3001\u8907\u6570\u306e\u30b5\u30a4\u30c8\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3057\u3001<code>*<\/code>\u3092\u4f7f\u3048\u3070\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30b5\u30a4\u30c8\u304c\u30ea\u30b9\u30c8\u306b\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8fd4\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>Http::fake(<strong>[<\/strong>\r\n<strong>    'your-site.test\/*' =&gt; Http::response($body, $status, $headers),<\/strong>\r\n<strong>    'your-site2.test\/*' =&gt; Http::response($body, $status, $headers),<\/strong>\r\n<strong>    '*' =&gt; Http::response($body, $status, $headers) \/\/ \u30b5\u30a4\u30c8\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408<\/strong>\r\n<strong>]<\/strong>);<\/pre>\n<h2>\u9023\u7d9a\u3057\u305f\u30ec\u30b9\u30dd\u30f3\u30b9<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u9806\u756a\u3067HTTP\u30a2\u30af\u30bb\u30b9\u3092\u30c6\u30b9\u30c8\u3057\u305f\u3044\u5834\u5408\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul>\n<li>http:\/\/your-site.test\/test<\/li>\n<li>http:\/\/your-site.test\/test2<\/li>\n<li>http:\/\/your-site.test\/test3<\/li>\n<\/ul>\n<p>\u3053\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>sequence()<\/code>\u3092\u4f7f\u3063\u3066\u51e6\u7406\u3057\u307e\u3059\u3002<\/p>\n<pre>Http::fake([\r\n    'your-site.test\/*' =&gt; Http::<strong>sequence()<\/strong>\r\n                                -&gt;push('\u30c6\u30b9\u30c8\u6587\u5b57\u5217', 200)\r\n                                -&gt;push(['key' =&gt; 'value'], 200)\r\n                                -&gt;pushStatus(404)\r\n                                -&gt;whenEmpty(Http::response()),\r\n]);<\/pre>\n<p>\u305d\u3057\u3066\u3001\u3082\u3057\u4ee5\u4e0b\u306e\u3088\u3046\u306b\uff13\u56de\u30a2\u30af\u30bb\u30b9\u3057\u305f\u5834\u5408\u30ec\u30b9\u30dd\u30f3\u30b9\u306f\u6307\u5b9a\u3057\u305f\u9806\u3067\u53d6\u5f97\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u3001\u3082\u3057\u8fd4\u3059\u3079\u304d\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u7121\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u306f<code>whenEmpty()<\/code>\u304c\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$response_1 = Http::get('http:\/\/your-site.test\/test');  \/\/ \u30c6\u30b9\u30c8\u6587\u5b57\u5217\r\n$response_2 = Http::get('http:\/\/your-site.test\/test2'); \/\/ ['key' =&gt; 'value']\r\n$response_3 = Http::get('http:\/\/your-site.test\/test3'); \/\/ 404<\/pre>\n<h2>\u6b63\u3057\u3044\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/h2>\n<p><code>Http::fake()<\/code>\u3092\u4f7f\u3063\u3066HTTP\u30a2\u30af\u30bb\u30b9\u3057\u305f\u76f4\u5f8c\u306b<code>assertSent()<\/code>\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u305d\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u6b63\u3057\u3044\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30d8\u30c3\u30c0\u30fc\u306e<code>X-Example<\/code>\u304c<code>test<\/code>\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre>$response = Http::withHeaders(['X-Example' =&gt; 'test'])-&gt;post('http:\/\/your-site.test\/test');\r\n\r\nHttp::<strong>assertSent<\/strong>(function ($request) {\r\n\r\n    return <strong>$request-&gt;hasHeader('X-Example', 'test')<\/strong>;\r\n\r\n});<\/pre>\n<p>\u307e\u305f\u3001<code>$request<\/code>\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u60c5\u5831\u3082\u542b\u307e\u308c\u3066\u3044\u308b\u306e\u3067\u3053\u308c\u3089\u3092\u4f7f\u3063\u3066\u300c\u672c\u5f53\u306b\u3053\u306e\u30a2\u30af\u30bb\u30b9\u306b\u306f\u5fc5\u8981\u306a\u60c5\u5831\u304c\u5165\u3063\u3066\u3044\u308b\u304b\uff1f\uff1f\u300d\u3092\u30c6\u30b9\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>$request-&gt;url()\u3000\u30fb\u30fb\u30fb\u3000\u30a2\u30af\u30bb\u30b9\u3057\u305fURL<\/li>\n<li>$request-&gt;method()\u3000\u30fb\u30fb\u30fb\u3000\u9001\u4fe1\u30e1\u30bd\u30c3\u30c9<\/li>\n<li>$request[&#8216;***&#8217;]\u3000\u30fb\u30fb\u30fb\u3000\u9001\u4fe1\u3057\u305f\u5024<\/li>\n<\/ul>\n<p>\u3088\u308a\u8a73\u3057\u3044\u30e1\u30bd\u30c3\u30c9\u306f\u3001<code>\/vendor\/laravel\/framework\/src\/Illuminate\/Http\/Client\/Request.php<\/code>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel 7.x<\/code>\u306e\u65b0\u3057\u3044<code>HTTP Client<\/code>\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u611f\u60f3\u3068\u3057\u3066\u306f\u3001\u78ba\u304b\u306b<code>Guzzle<\/code>\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u3067\u4f7f\u3044\u3084\u3059\u304f\u3066\u597d\u611f\u304c\u6301\u3066\u307e\u3057\u305f\u3002\u304a\u305d\u3089\u304f\u500b\u4eba\u7684\u306b\u3082\u4eca\u5f8c<code>Laravel<\/code>\u3067HTTP\u30a2\u30af\u30bb\u30b9\u3092\u3059\u308b\u5834\u5408\u306f\u4eca\u56de\u306e\u6a5f\u80fd\u3092\u4f7f\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u8a18\u4e8b Laravel 7.x\u306e\u65b0\u30eb\u30fc\u30c8\u6a5f\u80fd \u3067\u306f\u3001Laravel\u306e\u65b0\u3057\u3044\u30eb\u30fc\u30c8\u6a5f\u80fd\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002 \u305d\u3057\u3066\u3001\u4eca\u56de\u3082\u3053\u306e\u6d41\u308c\u3067\u4fbf\u5229\u306a\u300c\u3042\u308b\u6a5f\u80fd\u300d\u3092 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=6033\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel 7.x\u306e\u65b0\u3057\u3044HTTP Client\uff01\u5b9f\u4f8b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":6047,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-6033","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6033"}],"version-history":[{"count":17,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6033\/revisions"}],"predecessor-version":[{"id":6379,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6033\/revisions\/6379"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/6047"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}