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

Method Request

expect.go:607–622  ·  view source on GitHub ↗

Request returns a new Request instance. Arguments are similar to NewRequest. After creating request, all builders attached to Expect instance are invoked. See Builder.

(method, path string, pathargs ...interface{})

Source from the content-addressed store, hash-verified

605// After creating request, all builders attached to Expect instance are invoked.
606// See Builder.
607func (e *Expect) Request(method, path string, pathargs ...interface{}) *Request {
608 opChain := e.chain.enter("Request(%q)", method)
609 defer opChain.leave()
610
611 req := newRequest(opChain, e.config, method, path, pathargs...)
612
613 for _, builder := range e.builders {
614 builder(req)
615 }
616
617 for _, matcher := range e.matchers {
618 req.WithMatcher(matcher)
619 }
620
621 return req
622}
623
624// OPTIONS is a shorthand for e.Request("OPTIONS", path, pathargs...).
625func (e *Expect) OPTIONS(path string, pathargs ...interface{}) *Request {

Callers 7

OPTIONSMethod · 0.95
HEADMethod · 0.95
GETMethod · 0.95
POSTMethod · 0.95
PUTMethod · 0.95
PATCHMethod · 0.95
DELETEMethod · 0.95

Calls 4

newRequestFunction · 0.85
enterMethod · 0.80
leaveMethod · 0.80
WithMatcherMethod · 0.80

Tested by

no test coverage detected