php - 如何使用 file_get_contents() 获取网站 URL 云耀斑的内容
问题描述
这是我的代码:
$url = 'https://cryptoland.net/api/v1/live-price?q=selected'
$json = file_get_contents($url);
$obj = json_decode($json);
var_dump($obj) ;
当我在浏览器中手动使用 URL 时,它工作正常!
但是这个网站使用云耀斑 ddos 保护 file_get_contents 不工作并显示
failed to open stream: HTTP request failed! HTTP/1.1 503 Service Temporarily Unavailable
我该如何解决?
请帮我
解决方案
推荐阅读
- powershell - 测试路径的问题
- excel - 在工作表上添加行时如何在宏中保持正确的单元格引用
- azure - 如何连接到虚拟机内的本地 Oracle 数据库?
- excel - 类属性错误“需要对象”,但工作正常
- python - Django:如何构建食堂菜单预订系统以避免共现预订?
- python - 如何在 Django 模板的结果页面中突出显示搜索到的查询?
- python - simplejson.errors.JSONDecodeError:预期值:第 1 行第 1 列(字符 0)
- drupal - 对此视图进行编码的最佳解决方案是什么?
- ios - 电子书购买支付网关 iOS
- input - 如何获取 input[type="number"] 以将所有值显示为可选值?