php - Autodesk Forge :: localhost:3000 上的错误 404
问题描述
我正在尝试制作本教程(从这里Forge :查看您的模型)(php)并且我得到带有 HTTP 错误 404 的空白页面,知道吗?调试器中什么都没有,其他任何地方都没有......当调用这个uri http://localhost:3000/api/forge/oss/buckets我得到这个错误
( ! ) Notice: Undefined index: id in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\server\oss.php on line 54
Call Stack
# Time Memory Function Location
1 0.8060 405488 {main}( ) ...\index.php:0
2 0.8591 519816 Klein\Klein->dispatch( ) ...\index.php:50
3 0.8661 552248 Klein\Klein->handleRouteCallback( ) ...\Klein.php:572
4 0.8661 552248 call_user_func:{D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php:859} ( ) ...\Klein.php:859
5 0.8661 552248 {closure:D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\index.php:27-30}( ) ...\Klein.php:859
6 0.8661 552288 Autodesk\ForgeServices\DataManagement->getBucketsAndObjects( ) ...\index.php:29
( ! ) Fatal error: Uncaught InvalidArgumentException: Missing the required parameter $bucket_key when calling getObjects in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php on line 925
( ! ) Klein\Exceptions\UnhandledException: Missing the required parameter $bucket_key when calling getObjects in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php on line 925
Call Stack
# Time Memory Function Location
1 0.8060 405488 {main}( ) ...\index.php:0
2 0.8591 519816 Klein\Klein->dispatch( ) ...\index.php:50
3 0.8751 667432 Klein\Klein->error( ) ...\Klein.php:629
在尝试 localhost:3000/www/index.html 进行调试后,我Notice: Only variables should be passed by reference
在 oss.php 文件的第 65 行得到了这个。我还注意到已加载令牌和旧存储桶
解决方案
就像塞缪尔在评论中指出的那样,存储桶密钥没有提供给后端处理程序,因此出现了错误。
但实际上前端不处理空/不正确的桶键输入,因此在后端调用了错误......如果您想在这里捕获空输入,您可以实现自己的(检查输入的桶键是否有效)。 ..
推荐阅读
- spring - 使用 JDBCTemplate 、 Hikari 和 Teradata 的 Spring Boot
- r - 在 r 闪亮的模块中使用反应值
- algorithm - 这种朴素的素数分解算法有多快?
- javascript - Mocha 测试需要 done() 来结束,但随后会说“解决方法被过度指定。指定回调*或*返回 Promise;不是两者。”
- laravel - Laravel 6 - 如何通过用户字段值限制路由?
- matplotlib - 使用 Geopandas 绘制带有离散颜色条/图例的等值线图
- javascript - ReactJS - 状态变量行为异常
- typescript - 有没有办法让 VS Code 将 TypeScript 三斜杠指令添加到 VS Code 中 TS 文件的顶部?
- php - Laravel 5.8:beberlei/assert/lib/Assert/functions.php 返回类型产生错误
- swift - 如何将方法标记为“必需”