Home / Function/ Test_App_ReadBodyStream() — fiber Function Reference

Test_App_ReadBodyStream() — fiber Function Reference

Architecture documentation for the Test_App_ReadBodyStream() function in app_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  5f9b41f3_03f5_b13a_1217_9ca37ce130e5["Test_App_ReadBodyStream()"]
  e728fdd2_242f_706b_c1d2_041b3d6badb5["app_test.go"]
  5f9b41f3_03f5_b13a_1217_9ca37ce130e5 -->|defined in| e728fdd2_242f_706b_c1d2_041b3d6badb5
  style 5f9b41f3_03f5_b13a_1217_9ca37ce130e5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

app_test.go lines 2346–2359

func Test_App_ReadBodyStream(t *testing.T) {
	t.Parallel()
	app := New(Config{StreamRequestBody: true})
	app.Post("/", func(c Ctx) error {
		// Calling c.Body() automatically reads the entire stream.
		return c.SendString(fmt.Sprintf("%v %s", c.Request().IsBodyStream(), c.Body()))
	})
	testString := "this is a test"
	resp, err := app.Test(httptest.NewRequest(MethodPost, "/", bytes.NewBufferString(testString)))
	require.NoError(t, err, "app.Test(req)")
	body, err := io.ReadAll(resp.Body)
	require.NoError(t, err, "io.ReadAll(resp.Body)")
	require.Equal(t, "true "+testString, string(body))
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_App_ReadBodyStream() do?
Test_App_ReadBodyStream() is a function in the fiber codebase, defined in app_test.go.
Where is Test_App_ReadBodyStream() defined?
Test_App_ReadBodyStream() is defined in app_test.go at line 2346.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free