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

推送中 URL 出现问题时显示其字符串 #24

Closed
uetcis opened this issue Apr 7, 2019 · 2 comments
Closed

推送中 URL 出现问题时显示其字符串 #24

uetcis opened this issue Apr 7, 2019 · 2 comments

Comments

@uetcis
Copy link

uetcis commented Apr 7, 2019

如题,这样可以方便调试

@Finb
Copy link
Owner

Finb commented Apr 8, 2019

URL只要遵守通用规范即可 , 很容易调试

需要注意的点

  1. 特殊字符需要URL编码,不编码有可能导致URL结构出错或匹配错了路由
//例如
https://api.day.app/key/title/{推送内容}
//如果{推送内容}是
"a/b/c/"
//则最后的URL是
https://api.day.app/key/title/a/b/c/
//将找不到对应的路由,后端程序将返回404
  1. 按定义好的路由路径格式访问

URL出现问题 显示其出问题的部分不好实现

  1. URL如果拼错了,请求就到不了服务器

  2. 要么到了服务器,但是路由匹配错了,这时也需要你自己根据结果去判断是不是出问题了
    你本来想匹配 A 路由,但是写错了匹配到了B路由, 这时服务器不能确定你是搞错了,只会当成你成功请求了B。这是一个正常的成功的请求,不存在错误

  3. 参数错了,在返回的json response 中有具体的错误原因

  4. 访问了不存在的路径,根据http 状态码即可知道

@uetcis
Copy link
Author

uetcis commented Apr 12, 2019

是这样的,我在尝试用 IFTTT 的 Webhook 来推送,这样的话涉及到对请求的编码问题,所以会比较难调试。。。

@Finb Finb closed this as completed Feb 19, 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

2 participants