Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gmplato opened this issue Apr 28, 2021 · 6 comments
Open

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

gmplato opened this issue Apr 28, 2021 · 6 comments

Comments

@gmplato
Copy link

gmplato commented Apr 28, 2021

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

@ShigemoriHakura
Copy link
Contributor

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

@ShigemoriHakura
Copy link
Contributor

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

@gmplato
Copy link
Author

gmplato commented Apr 29, 2021

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

@billge1205
Copy link
Collaborator

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

@billge1205
Copy link
Collaborator

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

@gmplato
Copy link
Author

gmplato commented Apr 29, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants