fittinq/symfony-businesscentral
最新稳定版本:2.1.0
Composer 安装命令:
composer require fittinq/symfony-businesscentral
包简介
README 文档
README
The Symfony BusinessCentral HTTP Client, BusinessCentralHttpClient, is designed to simplify HTTP requests to BusinessCentral services with added headers and authentication.
Table of Contents
Introduction
The BusinessCentralHttpClient class is a Symfony component that enhances the standard Symfony HttpClient.
It adds headers, authentication credentials, and custom options for making requests to BusinessCentral services.
Installation
To use the Symfony BusinessCentral HTTP Client in your project, you can include it via Composer.
composer require fittinq/symfony-BusinessCentral
Usage
To use the BusinessCentralHttpClient, follow these steps:
Create an instance of the BusinessCentralHttpClient class, providing it with the required dependencies: HttpClientInterface, username, password, and API key.
use Fittinq\Symfony\BusinessCentral\BusinessCentralHttpClient; use Symfony\Contracts\HttpClient\HttpClientInterface; $httpClient = new HttpClient(); // Replace with your actual HttpClient instance. $username = '%env(BUSINESS_CENTRAL_USERNAME)%'; $password = '%env(BUSINESS_CENTRAL_PASSWORD)%'; $businessCentralHttpClient = new BusinessCentralHttpClient($httpClient, $username, $password, $apiKey);You can use the request method to send HTTP requests to BusinessCentral services. It automatically adds headers for Content-Type, login, password, and apiKey.
$url = 'https://businessCentral-service-url'; $options = ['headers' => ['custom-header' => 'value']]; $response = $businessCentralHttpClient->request('GET', $url, $options);
Configuration
Add the following parameters to your environment
BUSINESSCENTRAL_USERNAME=
BUSINESSCENTRAL_PASSWORD=
统计信息
- 总下载量: 39
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-03-05