PHP code example of paipe / phpclient

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

    

paipe / phpclient example snippets


$client = new paipe\phpclient\Client([
  'aaaUrl' => 'https://auth.paipe.com.br',
  'appKey' => 'app-key',
  'appSecret' => 'app-secret'
];


$response = $client->getService('cep')->request('GET' '/lookup', [ 
    'query' => ['keyword' => 'av paulista']
]);

$service = $client->getService('postal-code')
$resp = $service->request('POST' '/search', [ 
    'json' => ['foo' => 'data']
]);

$service = $client->getService('postal-code')
$resp = $service->request('POST' '/search', [ 
    'headers' => ['X-My-Header' => 'nice header'],
    'json' => ['foo' => 'data']
]);