This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Sample proposed changes to have Ctx act as an alias to req and res methods where possible | |
| // The Ctx API remains as-is for the most part. The implementation in DefaultCtx would be delegated | |
| // to new Request and Response objects. | |
| // Certain portions of the Ctx API exist because of the lack of distinct Request and Response APIs. | |
| // GetRespHeader, for example, is an artifact of overlap between request and response functionality (Get() was taken!). | |
| // It wouldn't need to exist if users could instead call `c.Res().Get("Content-Type")` | |
| // Gets the request's cookies | |
| func (c *DefaultCtx) Cookies(key string, defaultValue ...string) string { | |
| return c.req.Cookies(key, defaultValue) |