MCPcopy Create free account
hub / github.com/cli/cli / WithHeader

Function WithHeader

pkg/httpmock/stub.go:145–154  ·  view source on GitHub ↗
(responder Responder, header string, value string)

Source from the content-addressed store, hash-verified

143}
144
145func WithHeader(responder Responder, header string, value string) Responder {
146 return func(req *http.Request) (*http.Response, error) {
147 resp, _ := responder(req)
148 if resp.Header == nil {
149 resp.Header = make(http.Header)
150 }
151 resp.Header.Set(header, value)
152 return resp, nil
153 }
154}
155
156func StatusStringResponse(status int, body string) Responder {
157 return func(req *http.Request) (*http.Response, error) {

Calls 1

SetMethod · 0.65