MCPcopy
hub / github.com/mislav/hub / performRequest

Method performRequest

github/http.go:263–276  ·  view source on GitHub ↗
(method, path string, body io.Reader, configure func(*http.Request))

Source from the content-addressed store, hash-verified

261}
262
263func (c *simpleClient) performRequest(method, path string, body io.Reader, configure func(*http.Request)) (*simpleResponse, error) {
264 if path == "graphql" {
265 // FIXME: This dirty workaround cancels out the "v3" portion of the
266 // "/api/v3" prefix used for Enterprise. Find a better place for this.
267 path = "../graphql"
268 }
269 url, err := url.Parse(path)
270 if err == nil {
271 url = c.rootUrl.ResolveReference(url)
272 return c.performRequestUrl(method, url, body, configure)
273 } else {
274 return nil, err
275 }
276}
277
278func (c *simpleClient) performRequestUrl(method string, url *url.URL, body io.Reader, configure func(*http.Request)) (res *simpleResponse, err error) {
279 req, err := http.NewRequest(method, url.String(), body)

Callers 6

jsonRequestMethod · 0.95
GetMethod · 0.95
GetFileMethod · 0.95
DeleteMethod · 0.95
PostFileMethod · 0.95
GenericAPIRequestMethod · 0.80

Calls 2

performRequestUrlMethod · 0.95
ParseMethod · 0.45

Tested by

no test coverage detected