php curl ubuntu 400 bad request

77 views Asked by At

i have a working curl script and was testing it at my windows pc with xampp

<?php 

$username = '123';
$password = '123456';

$url = 'https://192.168.0.100/test';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
$exec = curl_exec($ch);

curl_close($ch);
echo $exec;
?>

Now I want to transfer it to my raspberry pi but i get an 400 error. Whats the difference with the code ?

Can you help me ?

Thanks

0

There are 0 answers