PHP code example of saxulum / saxulum-http-client-interface
1. Go to this page and download the library: Download saxulum/saxulum-http-client-interface 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/ */
saxulum / saxulum-http-client-interface example snippets
{.php}
$httpClient = new MyHttpClientImplementation;
$response = $httpClient->request(new Request(
'1.1',
Request::METHOD_GET,
'http://en.wikipedia.org',
array(
'Connection' => 'close',
)
));
{.php}
namespace Saxulum\HttpClient;
interface HttpClientInterface
{
/**
* @param Request $request
* @return Response
*/
public function request(Request $request);
}