Tencent / Biny

Biny is a tiny, high-performance PHP framework for web applications
BSD 3-Clause "New" or "Revised" License
1.69k stars 259 forks source link

我根据文档学着写restful API,但未能成功 #131

Open gmplato opened 3 years ago

gmplato commented 3 years ago

我用Postman测试接口,除GET外,POST,PUT,DELETE等都不行,是我忽略了什么问题了吗,我也是根据文档模仿测试。

ShigemoriHakura commented 3 years ago

如果传输的ContentType是application/json;charset=UTF-8或者application/json会解析失败,我也发现了,准备提pr

ShigemoriHakura commented 3 years ago

怪事,如果传application/json会跳转到json函数报错,我得再看看

gmplato commented 3 years ago

我暂时未遇到你的所说的问题,你是在客户端AJAX连接吗

billge1205 commented 3 years ago

Request.php 中有函数缺失 不知道哪个版本迁移时候遗漏了 不好意思 问题已修复 thx @ShigemoriHakura

billge1205 commented 3 years ago

@gmplato 我大概知道你的问题了 如果你用postman模拟的 应该都是被csrf验证拦掉了 可以在Action里加上 protected $csrfValidate = false; 绕过csrf验证 再试试

gmplato commented 3 years ago

好的,原来如此,怪不得一直测试不了,哈