prepared Task Executer
This commit is contained in:
+5
-6
@@ -11,20 +11,19 @@ $password = getenv("password");
|
||||
* @param array $data
|
||||
* @return bool|string
|
||||
*/
|
||||
function sendAPICompanySearchRequest(string $username, string $password, array $data): string|bool
|
||||
{
|
||||
function sendAPICompanySearchRequest(string $username, string $password, array $data): string|bool {
|
||||
|
||||
// API endpoint
|
||||
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/company/search';
|
||||
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/company/search';
|
||||
|
||||
// Headers
|
||||
$headers = array(
|
||||
$headers = array(
|
||||
"accept: application/json",
|
||||
"Content-Type: application/json"
|
||||
);
|
||||
|
||||
// Initialize cURL session
|
||||
$ch = curl_init();
|
||||
|
||||
$ch = curl_init();
|
||||
// Set cURL options
|
||||
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
|
||||
curl_setopt($ch, CURLOPT_URL, $apiUrl);
|
||||
|
||||
Reference in New Issue
Block a user