MCPcopy Create free account
hub / github.com/gavv/httpexpect / NewResponse

Function NewResponse

response.go:58–70  ·  view source on GitHub ↗

NewResponse returns a new Response instance. If reporter is nil, the function panics. If response is nil, failure is reported. If rtt is given, it defines response round-trip time to be reported by response.RoundTripTime().

(
	reporter Reporter, response *http.Response, rtt ...time.Duration,
)

Source from the content-addressed store, hash-verified

56// If rtt is given, it defines response round-trip time to be reported
57// by response.RoundTripTime().
58func NewResponse(
59 reporter Reporter, response *http.Response, rtt ...time.Duration,
60) *Response {
61 config := Config{Reporter: reporter}
62 config = config.withDefaults()
63
64 return newResponse(responseOpts{
65 config: config,
66 chain: newChainWithConfig("Response()", config),
67 httpResp: response,
68 rtt: rtt,
69 })
70}
71
72// NewResponse returns a new Response instance with config.
73//

Callers 15

TestResponse_RawFunction · 0.85
TestResponse_AliasFunction · 0.85
TestResponse_StatusFunction · 0.85
TestResponse_StatusRangeFunction · 0.85
TestResponse_StatusListFunction · 0.85
TestResponse_HeadersFunction · 0.85
TestResponse_CookiesFunction · 0.85
TestResponse_NoContentFunction · 0.85

Calls 3

withDefaultsMethod · 0.95
newResponseFunction · 0.85
newChainWithConfigFunction · 0.85

Tested by 15

TestResponse_RawFunction · 0.68
TestResponse_AliasFunction · 0.68
TestResponse_StatusFunction · 0.68
TestResponse_StatusRangeFunction · 0.68
TestResponse_StatusListFunction · 0.68
TestResponse_HeadersFunction · 0.68
TestResponse_CookiesFunction · 0.68
TestResponse_NoContentFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…