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{})
| 605 | // After creating request, all builders attached to Expect instance are invoked. |
| 606 | // See Builder. |
| 607 | func (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...). |
| 625 | func (e *Expect) OPTIONS(path string, pathargs ...interface{}) *Request { |