PHP code example of fishtail / http

1. Go to this page and download the library: Download fishtail/http 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/ */

    

fishtail / http example snippets


use Fishtail\Http;

$res = Http::get('https://www.baidu.com');

$url = 'http://example.com';
$header = [
	'Accept: */*',
	'Content-Type: text/plain;charset=UTF-8'
];
$cookie = 'token=2f2568ae-75f0-4ba9-98d4-8c139dad7f64';
$postData = [
	'page' => 1,
	'pageSize' => 20
];
$res = Http::post($url, $postData, $cookie, $header);