Answer the question
In order to leave comments, you need to log in
Why does cURL give a 403 Forbidden error when making a request?
Making a cURL request using php
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.cryptovoucher.io/merchant/voucher/partner');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n\t\"login\": \"123s\",\n\t\"password\": \"asdasdasdasdasd\",\n\t\"amount\": \"25\",\n\t\"currency\": \"EUR\",\n\t\"orderId\": \"3714cc3a-c25f-47e6-83fc-2da76fe27f340\"\n}");
$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
Answer the question
In order to leave comments, you need to log in
Forgot to authenticate.
Xs what kind of authorization is expected there, but when you open the page in the browser, a window appears for Basic authentication.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question