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