-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(net/ghttp): 修复请求成功时,返回数据的ghttp默认中间件message字段为空的问题 #4124
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
Conversation
修复请求成功时,ghttp默认返回数据中间件message字段为空的问题
@xyle 你好,请描述下这样修改的必要性呢?或者阐述下对应的业务场景? |
@xyle Hello, please describe the necessity of such modification? Or explain the corresponding business scenario? |
虽然message字段在API设计中不是严格必需的,但它通常被认为是一个有用的特性,因为它提供额外信息,有助于开发者理解响应的含义,并增强API的可用性。因此,在大多数情况下,建议包含message字段,特别是在API可能会被不同背景的开发者使用时。
在前端调用API接口时,部分接口不管请求成功或者失败,一般都会将该字段信息展示给用户,否则还需要手动处理提示信息。增加成功的消息可以简化该处理流程。
个人建议,请您考虑是否合理,谢谢!
田不甜Э
***@***.***
…------------------ 原始邮件 ------------------
发件人: "gogf/gf" ***@***.***>;
发送时间: 2025年1月22日(星期三) 上午10:21
***@***.***>;
***@***.******@***.***>;
主题: Re: [gogf/gf] fix(net/ghttp): 修复请求成功时,返回数据的ghttp默认中间件message字段为空的问题 (PR #4124)
@xyle 你好,请描述下这样修改的必要性呢?或者阐述下对应的业务场景?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Although message fields are not strictly required in API design, they are often considered a useful feature because they provide additional information, help developers understand what the response means, and enhance API usability. Therefore, in most cases it is recommended to include a message field, especially if the API may be used by developers of different backgrounds. Personal suggestions, please consider whether it is reasonable, thank you! Tian Butian
From: "gogf/gf" @.>; @xyle Hello, please describe the necessity of such modification? Or explain the corresponding business scenarios? — |
No description provided.