PHP code example of cdyun / php-http

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

    

cdyun / php-http example snippets


use Cdyun\PhpHttp\HttpEnforcer;

// 请求
HttpEnforcer::request($method, $url, $options = []);

// 请求参数
$options
- headers, body, query, json,form_params 等
- GET传参用query,POST传参用json,PUT传参用form_params