Files
api/services/nginx/app/modules/xlvask/interfaces/xlvask_request_i.php
T
Jepp9350 023b6992b6 Add xlvask module API integration
Introduced xlvask module with request handling, endpoints, and route mappings. Implemented functionalities to fetch usage logs, vehicles, and customers from the API, along with basic authentication support. Includes error handling and configuration setup for seamless integration.
2025-05-08 14:03:13 +02:00

37 lines
1.1 KiB
PHP

<?php
namespace xlvask\interfaces;
use Exception;
interface xlvask_request_i
{
/**
* Send a request to the xlvask API
* @param string $url The URL to send the request to
* @param string $method The HTTP method to use (GET, POST, PUT, DELETE)
* @param array $data The data to send with the request
* @param array $headers The headers to send with the request
* @return array The response from the API
* @throws Exception If there is an error with the request
* @throws Exception If the response is not valid JSON
* @throws Exception If the response is not successful
*/
public function sendRequest(
string $url,
string $method = 'GET',
array $data = [],
array $headers = []
): array;
/**
* Generate a Basic Auth header
* @param string $username The username for Basic Auth
* @param string $password The password for Basic Auth
* @return string The Basic Auth header
*/
public function generateBasicAuthHeader(
string $username,
string $password
): string;
}