PHP code example of b2 / http
1. Go to this page and download the library: Download b2/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/ */
b2 / http example snippets
(new Http)
->setHeader('Accept', 'json')
->parameter('q', 'value')
->get('xyz.com', function ($res) {
print_r($res);
});
(new Http)
->setHeader('Accept', 'json')
->parameter('q', 'value')
->post('xyz.com', function ($res) {
print_r($res);
});