0
我使用API来检查凭证代码是否存在。如果优惠券代码存在,一切都很好,但问题是,当我输入错误代码,然后我得到这个:使用404和来自API的响应
Client error: `GET https://apidev.example.co.uk/api/v1/vouchers/2869512_1-9FDS` resulted in a `404 Not Found` response:
{
"Code": 1000,
"Description": "Voucher no. is unknown please check and try again or contact Acorne on 0330 111 04 (truncated...)
我有这样的代码在后端(laravel PHP):
$res = json_decode($res->getBody()->getContents(), true);
dd($res);
如何我可以访问代码1000,并删除此错误屏幕?
分享的'DD($ RES)的结果;' – Sandeesh
如何处理错误消息? –
当有优惠券时,我使用dd($ res)图像更新问题 –