tme/api-client-guzzle

用于与TME API交互的Guzzle客户端

1.0.0 2023-09-21 12:07 UTC

This package is auto-updated.

Last update: 2024-09-21 14:17:37 UTC


README

此库提供了一个用于与TME API通信的Guzzle客户端。

更多信息请查看

安装

composer require tme/api-client-guzzle

示例用法

<?php

// Register your app here https://developers.tme.eu/en/dev
const TOKEN = '';
const SECRET = '';

require 'vendor/autoload.php';

// Factory Guzzle client.
$client = \TMEApi\ClientFactory::factoryForCredentials(TOKEN, SECRET);

// Send request
$options = [
    'form_params' => [
        'SymbolList' => [
            'NE555D',
            '1N4007-DIO'
        ],
        'Country' => 'US',
        'Language' => 'EN',
    ],
];

$result = $client->request('POST', '/Products/GetProducts.json', $options);

print_r(
    json_decode($result->getBody(), true)
);