add GetHTTPC

This commit is contained in:
wjqserver 2025-06-04 18:40:00 +08:00
parent 6eac3b2046
commit 385b6239c8

View file

@ -468,8 +468,7 @@ func (c *Context) ErrorUseHandle(code int) {
c.Abort()
return
} else {
// Default error handling if no custom handler is set
c.String(code, http.StatusText(code))
c.String(code, "%s", http.StatusText(code))
c.Abort()
}
}
@ -478,3 +477,8 @@ func (c *Context) ErrorUseHandle(code int) {
func (c *Context) GetProtocol() string {
return c.Request.Proto
}
// GetHTTPC 获取框架自带传递的httpc
func (c *Context) GetHTTPC() *httpc.Client {
return c.HTTPClient
}