Files
api/services/nginx/app/modules/limble/interfaces/limble_request_i.php
T

34 lines
1.0 KiB
PHP

<?php
interface limble_request_i
{
/**
* Send a request to the Limble 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 $client_id,
string $client_secret
): string;
}