PHP Classes

File: test/php/test2.php

Recommend this page to a friend!
  Classes of Nikos M.   Eazy HTTP   test/php/test2.php   Download  
File: test/php/test2.php
Role: Example script
Content typex: text/plain
Description: Example script
Class: Eazy HTTP
Send HTTP requests defined with a fluent interface
Author: By
Last change: Update of test/php/test2.php
Date: 1 month ago
Size: 612 bytes
 

Contents

Class file image Download
<?php
include(dirname(__FILE__) . '/../../src/php/EazyHttp.php');

function
request($do_http, $uri)
{
    return (new
EazyHttp())->option('methods', [$do_http])->get($uri);
}
function
test()
{
   
file_put_contents(dirname(__FILE__).'/test2-curl.php.html', request('curl', 'https://github.com/foo123/EazyHttp')->content);

   
file_put_contents(dirname(__FILE__).'/test2-file.php.html', request('file', 'https://github.com/foo123/EazyHttp')->content);

   
file_put_contents(dirname(__FILE__).'/test2-socket.php.html', request('socket', 'https://github.com/foo123/EazyHttp')->content);
}

test();