PHP code example of messier1001 / messier.httpclient
1. Go to this page and download the library: Download messier1001/messier.httpclient library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
messier1001 / messier.httpclient example snippets
try
{
echo \Messier\HttpClient\Client::Create()
->setGetParameters( [ 'q' => 'Wetter Dresden' ] )
->sendGet( 'https://www.google.de/#' );
}
catch ( \Throwable $ex )
{
echo $ex;
}
echo \Messier\HttpClient\Client::Create()
->onError( function( $errorMessage ) { echo 'There was an error :-('; exit; } )
->sendPost( 'http://fooooo.baaaar.baaaaaaaazz', [ 'action' => 'foo' ] );