PHP code example of ryodevz / httpwrapper

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

    

ryodevz / httpwrapper example snippets




use Ryodevz\Httpwrapper\Http;

$response = Http::get('https://example.com', ['user_id' => 1, 'category_id' => 1])
    ->send()  // Send Request
    ->body(); // Get Response



use Ryodevz\Httpwrapper\Http;

$response = Http::post('https://example.com', $data)
    ->send()  // Send Request
    ->body(); // Get Response



use Ryodevz\Httpwrapper\Http;

$response = Http::put('https://example.com', $data)
    ->send()  // Send Request
    ->body(); // Get Response



use Ryodevz\Httpwrapper\Http;

$response = Http::patch('https://example.com', $data)
    ->send()  // Send Request
    ->body(); // Get Response



use Ryodevz\Httpwrapper\Http;

$response = Http::delete('https://example.com', $data)
    ->send()  // Send Request
    ->body(); // Get Response



use Ryodevz\Httpwrapper\Http;

$headers = [
    'Content-Type' => 'application/json',
    'Accept' => 'application/json'
];

Http::withHeaders($headers)->post('https://example.com', $data)