PHP Classes

File: sample/request-sample.php

Recommend this page to a friend!
  Classes of Leonardo Di Sarli   PHP HTTP Request Library for Services   sample/request-sample.php   Download  
File: sample/request-sample.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP HTTP Request Library for Services
Send HTTP requests to Web services
Author: By
Last change:
Date: 9 months ago
Size: 306 bytes
 

Contents

Class file image Download
<?php

require_once __DIR__ . '/../vendor/autoload.php';

use
RequestService\Request;

$config = [
   
'your-service' => [
       
'url' => 'https://jsonplaceholder.typicode.com',
    ],
];

$sample = new Request($config);
$response = $sample->sendRequest(
   
'your-service',
   
'GET',
   
'todos/1'
);

print_r($response);