PHP code example of antibodies-online / dhl-rest-sdk
1. Go to this page and download the library: Download antibodies-online/dhl-rest-sdk 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/ */
antibodies-online / dhl-rest-sdk example snippets
use Antibodies\DHL\API\Rest\Client;
use Http\Discovery\Psr18ClientDiscovery;
use Psr\Http\Client\ClientInterface;
$config = new Config();
$dhlExpressUri = 'https://express.api.dhl.com/mydhlapi/test';
$psrClient = Psr18ClientDiscovery::find();
$httpClient = new PluginClient($psrClient, [
new BaseUriPlugin($dhlExpressUri),
new AuthenticationPlugin(
new BasicAuth($config->getClientId(), $config->getClientSecret())
),
]);
}
$client = new Client::create($httpClient);
$request = new SupermodelIoLogisticsExpressRateRequest();
// ... Fill the request object with data
$response = $client->expApiRatesMany(
requestBody: $request,
queryParameters: $queryParams
);