You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Laravel HTTP Facade在Job中返回500错误,Tinker中运行正常

Laravel Job中HTTP请求返回500,Tinker中执行正常
  • 已按相关测试方式验证,原请求对应的CURL命令如下:
curl -H "Authorization: Bearer 1G5bv.m*******"
     -H "Content-Type: application/json"
     -X POST https://testdashboard.com/api/reporting/314****/6912****/submit/202314*****
  • 使用Laravel Http facade发起请求(也尝试过原生PHP curl,结果一致),已通过var_dump确认URL完全正确、token无误:
$response = Http::withHeaders([
    'Authorization' => 'Bearer '.$this->auth_data['token'],
    'Content-Type' => 'application/json'
])->post($url);
  • 上述代码在Tinker中执行可正常运行,但在Laravel Job中执行时,服务端返回500错误,已联系服务端开发者等待回复。

内容的提问来源于stack exchange,提问作者TDawg

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 19:19:54