Testing Curl
This commit is contained in:
parent
dd28dc1c99
commit
dbec0cfb48
|
@ -1,10 +1,9 @@
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
//include 'env_vars.php';
|
//include 'env_vars.php';
|
||||||
//$username = getenv("username");
|
$username = getenv("username");
|
||||||
//$password = getenv("password");
|
$password = getenv("password");
|
||||||
$username = "username";
|
|
||||||
$password = "password";
|
|
||||||
|
|
||||||
// API endpoint
|
// API endpoint
|
||||||
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/apicompany/search';
|
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/apicompany/search';
|
||||||
|
@ -22,9 +21,10 @@ $data = array(
|
||||||
|
|
||||||
// Headers
|
// Headers
|
||||||
$headers = array(
|
$headers = array(
|
||||||
"apiKey: mykey"
|
"username:".$username,
|
||||||
|
"password:".$password
|
||||||
);
|
);
|
||||||
|
phpinfo();
|
||||||
// Initialize cURL session
|
// Initialize cURL session
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue