id stringlengths 16 145 | text stringlengths 1 179k | title stringclasses 1
value |
|---|---|---|
Process_Threads/8_224_0.txt | This method is similar to BodyParser , but for request headers. It is
important to use the struct tag "reqHeader". For example, if you want to parse
a request header with a field called Pass, you would use a struct field of `
reqHeader:"pass" ` .
Signature | |
Process_Threads/8_22_0.txt |
func (c *Ctx) App() *App
Example | |
Process_Threads/8_27_0.txt |
app.Get("/", func(c *fiber.Ctx) error {
c.Append("Link", "http://google.com", "http://localhost")
// => Link: http://localhost, http://google.com
c.Append("Link", "Test")
// => Link: http://localhost, http://google.com, Test
// ...
})
## ... | |
Process_Threads/8_0_0.txt | Skip to main content
🌟 If you like Fiber, don't forget to give us a star on Github 🌟 | |
Process_Threads/8_189_0.txt | Please note if that parameter is not in the request, zero will be returned. If
the parameter is not a number, it is still tried to be converted and usually
returned as 1.
info | |
Process_Threads/8_304_0.txt |
// X-Requested-With: XMLHttpRequest
app.Get("/", func(c *fiber.Ctx) error {
c.XHR() // true
// ...
})
## XML | |
Process_Threads/8_246_0.txt |
// Secure() method is equivalent to:
c.Protocol() == "https"
## Send | |
Process_Threads/8_113_0.txt | caution
Improper use of the X-Forwarded-For header can be a security risk. For
details, see the Security and privacy concerns section. | |
Process_Threads/25751_93_0.txt | Did not change the behaviour. (tested on ` v2.49.1 ` )
---
All reactions
Sorry, something went wrong. | |
Process_Threads/8_216_0.txt | If not specified, status defaults to 302 Found .
Signature | |
Process_Threads/8_242_0.txt |
func (c *Ctx) SaveFileToStorage(fileheader *multipart.FileHeader, path string, storage Storage) error
Example | |
Process_Threads/8_215_0.txt | Redirects back to refer URL. It redirects to fallback URL if refer header
doesn't exists, with specified status, a positive integer that corresponds to
an HTTP status code.
info | |
Process_Threads/1581_68_0.txt | Sorry, something went wrong.
Copy link | |
Process_Threads/8_76_0.txt | ## FormFile
MultipartForm files can be retrieved by name, the first file from the given
key is returned. | |
Process_Threads/25751_47_0.txt | v2.48.0
### Code Snippet (optional) | |
Process_Threads/8_82_0.txt | > Returned value is only valid within the handler. Do not store any
> references.
> Make copies or use the ` Immutable ` setting instead. Read more...
## Fresh | |
Process_Threads/8_74_0.txt | Signature
func (c *Ctx) Format(body interface{}) error
| |
Process_Threads/8_259_0.txt | info
For sending files from embedded file system this functionality can be used | |
Process_Threads/8_10_0.txt | info
Based on the request’s Accept HTTP header. | |
Process_Threads/8_34_0.txt | Add vars to default view var map binding to template engine. Variables are
read by the Render method and may be overwritten.
Signature | |
Process_Threads/1581_45_0.txt | ###
Fenny commented Feb 20, 2020 • | |
Process_Threads/8_28_0.txt | Sets the HTTP response Content-Disposition header field to ` attachment ` .
Signature | |
Process_Threads/8_29_0.txt |
func (c *Ctx) Attachment(filename ...string)
Example | |
Process_Threads/modifying-the-stack-on-windows-tib-and-exceptions6_47_0.txt | Jun 9, 2015 at 9:47
* I've modified my code to be more like yours for discussion. I can confirm this works as is, but the problem for me is two fold. Firstly, in general I need the current thread to be able to change it's own context (like swapcontext would do). I tried this, even with mods similar to yours, and I g... | |
Process_Threads/8_227_0.txt | Response return the *fasthttp.Response pointer
Signature | |
Process_Threads/8_91_0.txt | Signature
func (c *Ctx) GetReqHeaders() map[string][]string
| |
Process_Threads/modifying-the-stack-on-windows-tib-and-exceptions6_3_0.txt | * Stack Overflow
help chat | |
Process_Threads/8_56_0.txt | Returns *fasthttp.RequestCtx that is compatible with the context.Context
interface that requires a deadline, a cancellation signal, and other values
across API boundaries.
Signature | |
Process_Threads/8_50_0.txt |
app.Get("/", func(c *fiber.Ctx) error {
// Clears all cookies:
c.ClearCookie()
// Expire specific cookie by name:
c.ClearCookie("user")
// Expire multiple cookies by names:
c.ClearCookie("token", "session", "track_id", "version")
// ...... | |
Process_Threads/8_40_0.txt | ## Body
As per the header ` Content-Encoding ` , this method will try to perform a
file decompression from the body bytes. In case no ` Content-Encoding `
header is sent, it will perform as BodyRaw . | |
Process_Threads/8_205_0.txt | Redirects to the URL derived from the specified path, with specified status, a
positive integer that corresponds to an HTTP status code.
info | |
Process_Threads/25751_12_0.txt | For
* Enterprise
* Teams
* Startups
* Education | |
Process_Threads/8_45_0.txt | content-type | struct tag
---|---
` application/x-www-form-urlencoded ` | form
` multipart/form-data ` | form
` application/json ` | json
` application/xml ` | xml
` text/xml ` | xml
Signature
func (c *Ctx) BodyParser(out interface{}) error
| |
Process_Threads/1581_9_0.txt | Plan and track work
* Discussions | |
Process_Threads/1581_71_0.txt | >> app := fiber.New()
>> app.Use("/api", func(c *fiber.Ctx) { | |
Process_Threads/8_57_0.txt |
func (c *Ctx) Context() *fasthttp.RequestCtx
info | |
Process_Threads/8_302_0.txt | A Boolean property, that is ` true ` , if the request’s X-Requested-With
header field is XMLHttpRequest , indicating that the request was issued by a
client library (such as jQuery ).
Signature | |
Process_Threads/8_37_0.txt | Returns the raw request body .
Signature | |
Process_Threads/25751_50_0.txt | the-hotmann added the ☢️ Bug label Aug 13, 2023
Copy link | |
Process_Threads/8_238_0.txt | Method is used to save any multipart file to disk.
Signature | |
Process_Threads/25751_105_0.txt | the-hotmann closed this as completed Nov 22, 2023
gaby reopened this Nov 22, 2023 | |
Process_Threads/8_309_0.txt | Previous
🚀 App | |
Process_Threads/modifying-the-stack-on-windows-tib-and-exceptions6_84_0.txt | * Technology
* Culture & recreation
* Life & arts
* Science
* Professional
* Business
* API
* Data
* Blog
* Facebook
* Twitter
* LinkedIn
* Instagram | |
Process_Threads/Process_Threads_2_2.txt | -us/windows/desktop/api/WinBase/nf-winbase-enterumsschedulingmode) .
* When a UMS worker thread calls [ **UmsThreadYield** ](/en-us/windows/desktop/api/WinBase/nf-winbase-umsthreadyield) .
* When a UMS worker thread blocks on a system service such as a system call or a page fault.
The _Reason_ parameter of the ... | |
Process_Threads/25751_41_0.txt | edited
### Bug Description | |
Process_Threads/8_31_0.txt | Returns the base URL ( protocol \+ host ) as a ` string ` .
Signature | |
Process_Threads/8_62_0.txt | This method is similar to BodyParser , but for cookie parameters. It is
important to use the struct tag "cookie". For example, if you want to parse a
cookie with a field called Age, you would use a struct field of ` cookie:"age"
` .
Signature | |
Process_Threads/8_208_0.txt |
app.Get("/coffee", func(c *fiber.Ctx) error {
return c.Redirect("/teapot")
})
app.Get("/teapot", func(c *fiber.Ctx) error {
return c.Status(fiber.StatusTeapot).Send("🍵 short and stout 🍵")
})
More examples | |
Process_Threads/25751_39_0.txt | Copy link
Contributor | |
Process_Threads/1581_1_0.txt | Toggle navigation
Sign in | |
Process_Threads/25751_8_0.txt | Manage code changes
* Issues | |
Process_Threads/8_143_0.txt |
func (c *Ctx) MultipartForm() (*multipart.Form, error)
Example | |
Process_Threads/25751_84_0.txt | Sorry, something went wrong.
Copy link | |
Process_Threads/Process_Threads_3_0.txt | Skip to main content
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security
updates, and technical support.
[ Download Microsoft Edge ](https://go.microsoft.com/fwlink/p/?LinkID=2092881
) [ More info about Internet Explorer and Microsoft Edge
](https://learn... | |
Process_Threads/8_125_0.txt | ## JSONP
Sends a JSON response with JSONP support. This method is identical to JSON ,
except that it opts-in to JSONP callback support. By default, the callback
name is simply callback. | |
Process_Threads/modifying-the-stack-on-windows-tib-and-exceptions6_54_0.txt | ### Sign up or log in
Sign up using Google | |
Process_Threads/8_18_0.txt | Params is used to get all route parameters. Using Params method to get params.
Signature | |
Process_Threads/8_214_0.txt |
app.Get("/", func(c *fiber.Ctx) error {
// /user/fiber
return c.RedirectToRoute("user", fiber.Map{
"name": "fiber"
})
})
app.Get("/with-queries", func(c *fiber.Ctx) error {
// /user/fiber?data[0][name]=john&data[0][age]=10&test=doe
retur... | |
Process_Threads/8_85_0.txt |
func (c *Ctx) Fresh() bool
## Get | |
Process_Threads/25751_103_0.txt | ###
the-hotmann commented Nov 22, 2023 | |
Process_Threads/8_235_0.txt |
// http://localhost:8080/hello
app.Get("/hello/:name", func(c *fiber.Ctx) error {
r := c.Route()
fmt.Println(r.Method, r.Path, r.Params, r.Handlers)
// GET /hello/:name handler [name]
// ...
})
caution | |
Process_Threads/8_254_0.txt | caution
Method doesn´t use gzipping by default, set it to true to enable. | |
Process_Threads/modifying-the-stack-on-windows-tib-and-exceptions6_70_0.txt | Vectored Exception Handling During StackOverflowException
4 | |
Process_Threads/1581_60_0.txt | acidjazz commented Sep 21, 2022
This is an awesome feature in the Context - might want to list it as a feature
elsewhere so this isn't the route to find it!
---
All reactions | |
Process_Threads/1581_4_0.txt | Host and manage packages
* Security | |
Process_Threads/8_138_0.txt |
app.Post("/", func(c *fiber.Ctx) error {
c.Location("http://example.com")
c.Location("/foo/bar")
return nil
})
## Method | |
Process_Threads/8_163_0.txt | ## ParamsParser
This method is similar to BodyParser, but for path parameters. It is important
to use the struct tag "params". For example, if you want to parse a path
parameter with a field called Pass, you would use a struct field of
params:"pass" | |
Process_Threads/8_209_0.txt |
app.Get("/", func(c *fiber.Ctx) error {
return c.Redirect("/foo/bar")
return c.Redirect("../login")
return c.Redirect("http://example.com")
return c.Redirect("http://example.com", 301)
})
## RedirectToRoute | |
Process_Threads/modifying-the-stack-on-windows-tib-and-exceptions6_61_0.txt | By clicking “Post Your Answer”, you agree to our terms of service and
acknowledge you have read our privacy policy .
## | |
Process_Threads/25751_27_0.txt | Sign up
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 | |
Process_Threads/25751_28_0.txt | {{ message }}
gofiber / fiber Public | |
Process_Threads/8_293_0.txt | Write adopts the Writer interface
Signature | |
Process_Threads/8_268_0.txt | Signature
func SetParserDecoder(parserConfig fiber.ParserConfig{
IgnoreUnknownKeys bool,
ParserType []fiber.ParserType{
Customtype interface{},
Converter func(string) reflect.Value,
},
ZeroEmpty bool,
SetAliasTag string... | |
Process_Threads/modifying-the-stack-on-windows-tib-and-exceptions6_69_0.txt | How rethrow an exception without losing the original call stack?
2 | |
Process_Threads/1581_27_0.txt | Sign up
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 | |
Process_Threads/25751_35_0.txt | the-hotmann opened this issue Aug 13, 2023 · 14 comments
Open | |
Process_Threads/8_281_0.txt |
func (c *Ctx) Subdomains(offset ...int) []string
Example | |
Process_Threads/1581_43_0.txt |
All reactions
hyingreborn added the question label Feb 20, 2020 | |
Process_Threads/modifying-the-stack-on-windows-tib-and-exceptions6_21_0.txt | 2
The origin of my question effectively stems from wanting to provide an
implementation of pthreads on Windows which supports user provide stacks.
Specifically, ` pthread_attr_setstack ` should do something meaningful. My
actual requirements are a bit more involved than this but this is good enough
for the purpose of ... | |
Process_Threads/1581_58_0.txt | * 👍 2 reactions
Sorry, something went wrong. | |
Process_Threads/8_218_0.txt |
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Home page")
})
app.Get("/test", func(c *fiber.Ctx) error {
c.Set("Content-Type", "text/html")
return c.SendString(`<a href="/back">Back</a>`)
})
app.Get("/back", func(c *fiber.Ctx) error { ... | |
Process_Threads/8_231_0.txt |
func (c *Ctx) RestartRouting() error
Example | |
Process_Threads/8_232_0.txt |
app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("From /new")
})
app.Get("/old", func(c *fiber.Ctx) error {
c.Path("/new")
return c.RestartRouting()
})
## Route | |
Process_Threads/1581_41_0.txt | ### middleware/jwt.go
package middleware
func JwtAuth() {
// parse authorization
c.Set("claims", claims)
c.Next()
} | |
Process_Threads/8_271_0.txt | Signature
func (c *Ctx) SetUserContext(ctx context.Context)
| |
Process_Threads/8_53_0.txt | ClientHelloInfo contains information from a ClientHello message in order to
guide application logic in the GetCertificate and GetConfigForClient
callbacks. You can refer to the ClientHelloInfo struct documentation for
more information on the returned struct.
Signature | |
Process_Threads/8_267_0.txt | ## SetParserDecoder
Allow you to config BodyParser/QueryParser decoder, base on schema's options,
providing possibility to add custom type for parsing. | |
Process_Threads/25751_98_0.txt | ctx.JSON will set the content type to ` application/json ` without specifying
encoding. This can lead to client-side undefined behavior based on if they
follow the RFC or not. As a way to mitigate undefined behavior, having the
UTF-8 encoding by default would be nice, but I'm not sure it's exactly a bug.
A solution req... | |
Process_Threads/25751_79_0.txt | > As Fiber receives it and does not encode it properly.
Are you sure about this
What I marked should actually mean that json is in utf8 by default Can you
prepare an example where it is shown that fiber does not encode the json
correctly Curl request + golang api
---
All reactions | |
Process_Threads/25751_61_0.txt | Copy link
Member | |
Process_Threads/8_116_0.txt | Signature
func (c *Ctx) Is(extension string) bool
| |
Process_Threads/modifying-the-stack-on-windows-tib-and-exceptions6_76_0.txt | Stack unwinding with (un)caught exceptions
#### Hot Network Questions | |
Process_Threads/modifying-the-stack-on-windows-tib-and-exceptions6_0_0.txt | Skip to main content
Stack Overflow | |
Process_Threads/8_223_0.txt |
app.Get("/", func(c *fiber.Ctx) error {
c.Request().Header.Method()
// => []byte("GET")
})
## ReqHeaderParser | |
Process_Threads/8_295_0.txt |
app.Get("/", func(c *fiber.Ctx) error {
c.Write([]byte("Hello, World!")) // => "Hello, World!"
fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})
## Writef | |
Process_Threads/8_136_0.txt | Sets the response Location HTTP header to the specified path parameter.
Signature | |
Process_Threads/25751_0_0.txt | Skip to content
## Navigation Menu | |
Process_Threads/1581_64_0.txt | All reactions
* 👍 1 reaction | |
Process_Threads/8_190_0.txt | Defaults to the float64 zero ( ` 0 ` ), if the param doesn't exist.
Signature | |
Process_Threads/8_55_0.txt |
// GET http://example.com/hello
app.Get("/hello", func(c *fiber.Ctx) error {
chi := c.ClientHelloInfo()
// ...
})
## Context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.