Test_Response_Headers() — fiber Function Reference
Architecture documentation for the Test_Response_Headers() function in response_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD 1ccf458e_ea45_46ef_71d3_d0edcccfee32["Test_Response_Headers()"] 9a680627_ad54_340e_3faa_64ead9b39aef["response_test.go"] 1ccf458e_ea45_46ef_71d3_d0edcccfee32 -->|defined in| 9a680627_ad54_340e_3faa_64ead9b39aef style 1ccf458e_ea45_46ef_71d3_d0edcccfee32 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
client/response_test.go lines 205–241
func Test_Response_Headers(t *testing.T) {
t.Parallel()
server := startTestServer(t, func(app *fiber.App) {
app.Get("/", func(c fiber.Ctx) error {
c.Response().Header.Add("foo", "bar")
c.Response().Header.Add("foo", "bar2")
c.Response().Header.Add("foo2", "bar")
return c.SendString("hello world")
})
})
defer server.stop()
client := New().SetDial(server.dial())
resp, err := AcquireRequest().
SetClient(client).
Get("http://example.com")
require.NoError(t, err)
headers := make(map[string][]string)
for k, v := range resp.Headers() {
headers[k] = append(headers[k], v...)
}
require.Equal(t, "hello world", resp.String())
require.Contains(t, headers["Foo"], "bar")
require.Contains(t, headers["Foo"], "bar2")
require.Contains(t, headers["Foo2"], "bar")
require.Len(t, headers, 5) // Foo + Foo2 + Date + Content-Length + Content-Type
resp.Close()
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Test_Response_Headers() do?
Test_Response_Headers() is a function in the fiber codebase, defined in client/response_test.go.
Where is Test_Response_Headers() defined?
Test_Response_Headers() is defined in client/response_test.go at line 205.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free