You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns [\*fasthttp.RequestCtx](https://godoc.org/github.com/valyala/fasthttp#RequestCtx) that is compatible with the context.Context interface that requires a deadline, a cancellation signal, and other values across API boundaries.
357
+
Context returns a context implementation that was set by user earlier or returns a non-nil, empty context, if it was not set earlier.
358
358
359
359
```go title="Signature"
360
-
func(cCtx) Context() *fasthttp.RequestCtx
360
+
func(cCtx) Context() context.Context
361
361
```
362
362
363
-
:::info
364
-
Please read the [Fasthttp Documentation](https://pkg.go.dev/github.com/valyala/fasthttp?tab=doc) for more information.
Returns [\*fasthttp.RequestCtx](https://godoc.org/github.com/valyala/fasthttp#RequestCtx) that is compatible with the context.Context interface that requires a deadline, a cancellation signal, and other values across API boundaries.
1500
+
1501
+
```go title="Signature"
1502
+
func (c Ctx) RequestCtx() *fasthttp.RequestCtx
1503
+
```
1504
+
1505
+
:::info
1506
+
Please read the [Fasthttp Documentation](https://pkg.go.dev/github.com/valyala/fasthttp?tab=doc) for more information.
1507
+
:::
1508
+
1509
+
1492
1510
## Response
1493
1511
1494
1512
Response return the [\*fasthttp.Response](https://godoc.org/github.com/valyala/fasthttp#Response) pointer
Context returns a context implementation that was set by user earlier
2011
-
or returns a non-nil, empty context, if it was not set earlier.
2012
-
2013
-
```go title="Signature"
2014
-
func (c Ctx) Context() context.Context
2015
-
```
2016
-
2017
-
```go title="Example"
2018
-
app.Get("/", func(c fiber.Ctx) error {
2019
-
ctx := c.Context()
2020
-
// ctx is context implementation set by user
2021
-
2022
-
// ...
2023
-
})
2024
-
```
2025
-
2026
2026
## Vary
2027
2027
2028
2028
Adds the given header field to the [Vary](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary) response header. This will append the header, if not already listed, otherwise leaves it listed in the current location.
0 commit comments