{"id":62819,"date":"2021-05-21T04:10:06","date_gmt":"2021-05-21T08:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/installing-guzzle-php\/"},"modified":"2021-05-21T04:10:06","modified_gmt":"2021-05-21T08:10:06","slug":"installing-guzzle-php","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=62819","title":{"rendered":"Installing Guzzle #PHP"},"content":{"rendered":"<p>&#8220;Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services.&#8221;<\/p>\n<p>http:\/\/docs.guzzlephp.org\/en\/latest\/index.html<br \/>\nAnd from my .bash_history, the installation process<\/p>\n<p>curl -sS https:\/\/getcomposer.org\/installer | php<br \/>\nphp composer.phar require guzzlehttp\/guzzle:~6.0<\/p>\n<p>To Contribute to Guzzle:<br \/>\ngit clone https:\/\/github.com\/guzzle\/guzzle.git<br \/>\ncd guzzle &amp;&amp; curl -s http:\/\/getcomposer.org\/installer | php &amp;&amp; .\/composer.phar install &#8211;dev<br \/>\nmake test<br \/>\nsudo make test<br \/>\nnode<br \/>\nsudo node<br \/>\nbrew install node<br \/>\nnode -v<br \/>\nbrew update<br \/>\nmake test<\/p>\n<p>&#8212;<br \/>\nand you can write a simple PHP script as below to access Github<br \/>\nI tried the code as below with real Github user accounts and the code works.<\/p>\n<p>request(&#8216;GET&#8217;, &#8216;https:\/\/api.github.com\/user&#8217;, [<br \/>\n    &#8216;auth&#8217; =&gt; [&#8216;user-name&#8217;, &#8216;password&#8217;]<br \/>\n]);<br \/>\necho $res-&gt;getStatusCode();<br \/>\n\/\/ &#8220;200&#8221;<br \/>\necho $res-&gt;getHeader(&#8216;content-type&#8217;);<br \/>\n\/\/ &#8216;application\/json; charset=utf8&#8242;<br \/>\necho $res-&gt;getBody();<br \/>\n\/\/ {&#8220;type&#8221;:&#8221;User&#8221;&#8230;&#8217;<\/p>\n<p>\/\/ Send an asynchronous request.<br \/>\n$request = new GuzzleHttpPsr7Request(&#8216;GET&#8217;, &#8216;http:\/\/httpbin.org&#8217;);<br \/>\n$promise = $client-&gt;sendAsync($request)-&gt;then(function ($response) {<br \/>\n    echo &#8216;I completed! &#8216; . $response-&gt;getBody();<br \/>\n});<br \/>\n$promise-&gt;wait();<\/p>\n<p> From: http:\/\/sitestree.com\/?p=4655<br \/> Categories:PHP<br \/>Tags:<br \/> Post Data:2016-11-28 22:55:29<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services.&#8221; http:\/\/docs.guzzlephp.org\/en\/latest\/index.html And from my .bash_history, the installation process curl -sS https:\/\/getcomposer.org\/installer | php php composer.phar require guzzlehttp\/guzzle:~6.0 To Contribute to Guzzle: git clone https:\/\/github.com\/guzzle\/guzzle.git cd guzzle &amp;&amp; curl -s http:\/\/getcomposer.org\/installer | php &amp;&amp; .\/composer.phar &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=62819\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-62819","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":65780,"url":"http:\/\/bangla.sitestree.com\/?p=65780","url_meta":{"origin":62819,"position":0},"title":"Configure Mac OsX for Laravel Development with Valet #Laravel","author":"Author-Check- Article-or-Video","date":"July 14, 2021","format":false,"excerpt":"\/usr\/bin\/ruby -e \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install)\" brew update brew install homebrew\/php\/php71 composer global require laravel\/valet export PATH=$PATH:~\/.composer\/vendor\/bin --- not required curl -sS https:\/\/getcomposer.org\/installer | php curl https:\/\/getcomposer.org\/installer | php --- php -r \"copy('https:\/\/getcomposer.org\/installer', 'composer-setup.php');\" php -r \"if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt';\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14846,"url":"http:\/\/bangla.sitestree.com\/?p=14846","url_meta":{"origin":62819,"position":1},"title":"Learn some CentOS Linux : Redhat Linux","author":"Sayed","date":"June 29, 2019","format":false,"excerpt":"This is mostly about Centos Linux. However, this also shows commands related to how to install Magento 2 on LEMP (E for Nginx Web-server). Some PHP related stuff are there as well. LEMP + CentOS + Magento 2 : VM Image or one click install: I did not see readily\u2026","rel":"","context":"In &quot;Magento 2&quot;","block_context":{"text":"Magento 2","link":"http:\/\/bangla.sitestree.com\/?cat=1907"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":25055,"url":"http:\/\/bangla.sitestree.com\/?p=25055","url_meta":{"origin":62819,"position":2},"title":"Learn and practice some CentOS Linux : Redhat Linux #Root","author":"Author-Check- Article-or-Video","date":"April 15, 2021","format":false,"excerpt":"This is mostly about Centos Linux. However, this also shows commands related to how to install Magento 2 on LEMP (E for Nginx Web-server). Some PHP related stuff are there as well. Let's Encrypt included. LEMP + CentOS + Magento 2 : VM Image or one click install: I did\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":21831,"url":"http:\/\/bangla.sitestree.com\/?p=21831","url_meta":{"origin":62819,"position":3},"title":"Some Ubuntu Linux Commands used in AWS platform #Unix\/Linux #RHCSA","author":"Author-Check- Article-or-Video","date":"March 7, 2021","format":false,"excerpt":"Some Ubuntu Linux Commands used in AWS platform Some might be run by the parent commands This is kinda cleaned up from .bash_history (removed repeating and sensitive commands), still not perfectly cleaned up - so you will see lots of ls, cd, dir or similar \u00a0 sudo apt-get update sudo\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5416,"url":"http:\/\/bangla.sitestree.com\/?p=5416","url_meta":{"origin":62819,"position":4},"title":"Install a PHP MySQL Project from GitHUB","author":"Sayed","date":"October 26, 2014","format":false,"excerpt":"","rel":"","context":"In &quot;Root&quot;","block_context":{"text":"Root","link":"http:\/\/bangla.sitestree.com\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":75891,"url":"http:\/\/bangla.sitestree.com\/?p=75891","url_meta":{"origin":62819,"position":5},"title":"Install a PHP MySQL Project from GitHUB","author":"Sayed","date":"September 3, 2023","format":false,"excerpt":"https:\/\/youtu.be\/kHGdTlnDsRk","rel":"","context":"In &quot;From Youtube Channel&quot;","block_context":{"text":"From Youtube Channel","link":"http:\/\/bangla.sitestree.com\/?cat=1952"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/img.youtube.com\/vi\/kHGdTlnDsRk\/0.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/62819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=62819"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/62819\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=62819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=62819"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=62819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}