Home / Function/ TestContextNegotiationFormatWithAccept() — gin Function Reference

TestContextNegotiationFormatWithAccept() — gin Function Reference

Architecture documentation for the TestContextNegotiationFormatWithAccept() function in context_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  cc598a95_1b3a_aeb3_38b8_0c5b19a2f451["TestContextNegotiationFormatWithAccept()"]
  ebe0ae48_a62b_a38f_5bac_5bbbd96fc508["context_test.go"]
  cc598a95_1b3a_aeb3_38b8_0c5b19a2f451 -->|defined in| ebe0ae48_a62b_a38f_5bac_5bbbd96fc508
  style cc598a95_1b3a_aeb3_38b8_0c5b19a2f451 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

context_test.go lines 1745–1753

func TestContextNegotiationFormatWithAccept(t *testing.T) {
	c, _ := CreateTestContext(httptest.NewRecorder())
	c.Request, _ = http.NewRequest(http.MethodPost, "/", nil)
	c.Request.Header.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9;q=0.8")

	assert.Equal(t, MIMEXML, c.NegotiateFormat(MIMEJSON, MIMEXML))
	assert.Equal(t, MIMEHTML, c.NegotiateFormat(MIMEXML, MIMEHTML))
	assert.Empty(t, c.NegotiateFormat(MIMEJSON))
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does TestContextNegotiationFormatWithAccept() do?
TestContextNegotiationFormatWithAccept() is a function in the gin codebase, defined in context_test.go.
Where is TestContextNegotiationFormatWithAccept() defined?
TestContextNegotiationFormatWithAccept() is defined in context_test.go at line 1745.

Analyze Your Own Codebase

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

Try Supermodel Free