我試圖使用BlockCypher API接受以太坊。從他們的文檔(https://dev.blockcypher.com/eth/#address-endpoint),他們要求發送一個cURL請求來獲取地址。PHP cURL發佈API
我已經試過這樣: -
<?php
$a = "https://api.blockcypher.com/v1/eth/main/addrs?token=my_token";
$b = file_get_contents($a);
var_dump($b);
?>
這給了我這個錯誤: -
Warning: file_get_contents(https://api.blockcypher.com/v1/eth/main/addrs?token=my_token): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\wamp\www\x\backend\dev\t.php on line 3
如果我嘗試直接在網頁上運行的URL,我得到這個錯誤: -
Endpoint not found. Please check your URL for typos and make sure you're using the correct HTTP method (GET, POST, etc).
我在做什麼錯?
使用了錯誤的網址是什麼?我假設你已經審查了你的實際標記,並且沒有真正將'my_token'發送給服務? –
@MarcB 正確,我剛剛審查過它。實際上,我在那裏使用了我的原始令牌。 – RobertPuerco