PHP code example of jl6m / swagger-lite
1. Go to this page and download the library: Download jl6m/swagger-lite 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/ */
jl6m / swagger-lite example snippets
use JL6m\SwaggerLite\SwaggerClient;
$client = new SwaggerClient([
'scheme' => 'https',
'swagger' => 'http://example.com/service/swagger.json',
'auth' => ['client_id', 'client_secret'],
]);
$response = $client->post('/users/{userId}/messages', [
'userId' => '11830955',
'subject' => 'Hello',
'content' => 'Hello, it\'s me.',
]);