MCPcopy Create free account
hub / github.com/imroc/req / TestSetHeaderNonCanonical

Function TestSetHeaderNonCanonical

request_test.go:545–569  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

543}
544
545func TestSetHeaderNonCanonical(t *testing.T) {
546 // set headers
547 key := "spring.cloud.function.Routing-expression"
548 c := tc().EnableForceHTTP1()
549 resp, err := c.R().EnableDumpWithoutResponse().
550 SetHeadersNonCanonical(map[string]string{
551 key: "test",
552 }).Get("/header")
553 assertSuccess(t, resp, err)
554 tests.AssertEqual(t, true, strings.Contains(resp.Dump(), key))
555
556 resp, err = c.R().
557 EnableDumpWithoutResponse().
558 SetHeaderNonCanonical(key, "test").
559 Get("/header")
560 assertSuccess(t, resp, err)
561 tests.AssertEqual(t, true, strings.Contains(resp.Dump(), key))
562
563 c.SetCommonHeaderNonCanonical(key, "test")
564 resp, err = c.R().
565 EnableDumpWithoutResponse().
566 Get("/header")
567 assertSuccess(t, resp, err)
568 tests.AssertEqual(t, true, strings.Contains(resp.Dump(), key))
569}
570
571func TestQueryParam(t *testing.T) {
572 testWithAllTransport(t, testQueryParam)

Callers

nothing calls this directly

Calls 11

AssertEqualFunction · 0.92
tcFunction · 0.85
assertSuccessFunction · 0.85
RMethod · 0.80
DumpMethod · 0.80
SetHeaderNonCanonicalMethod · 0.80
EnableForceHTTP1Method · 0.45
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…