Why is API returning 405:Not Allowed?
-
Colleagues, good night
Trying to use API: https://developer.bitaps.com/forwarding
I'm asking POST:
$url = 'https://api.bitaps.com/btc/v1/create/payment/address '; // url, на который отправляется запрос $post_data = array( "forwarding_address"=>"bc1qhlknxc3yqu6z6qy64aascvn23tc8zapc46ynag", "callback_link"=>"https://testshopbot.ru/recieve.php", "confirmations"=>1 ); $headers = array('Content-Type' => 'application/json'); // заголовки запроса $post_data=json_encode($post_data); $curl = curl_init(); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POST, true); // true - означает, что отправляется POST запрос $result = curl_exec($curl);
var_dump($result);
but always returns one mistake 405:Method not Allowed
Who's gonna tell you why?
-
$url = 'https://api.bitaps.com/btc/v1/create/payment/address'; // url, на который отправляется запрос $post_data = array( "forwarding_address"=>"bc1qhlknxc3yqu6z6qy64aascvn23tc8zapc46ynag", "callback_link"=>"https://testshopbot.ru/recieve.php", "confirmations"=>1 ); $headers = array('Content-Type' => 'application/json'); // заголовки запроса $post_data=json_encode($post_data); $curl = curl_init(); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POST, true); // true - означает, что отправляется POST запрос $result = curl_exec($curl); var_dump($result);
Try to make a request, just in the end of the url there was a gap.