MCPcopy
hub / github.com/cli/cli / REST

Method REST

api/client.go:104–111  ·  view source on GitHub ↗

REST performs a REST request and parses the response.

(hostname string, method string, p string, body io.Reader, data interface{})

Source from the content-addressed store, hash-verified

102
103// REST performs a REST request and parses the response.
104func (c Client) REST(hostname string, method string, p string, body io.Reader, data interface{}) error {
105 opts := clientOptions(hostname, c.http.Transport)
106 restClient, err := ghAPI.NewRESTClient(opts)
107 if err != nil {
108 return err
109 }
110 return handleResponse(restClient.Do(method, p, body, data))
111}
112
113func (c Client) RESTWithNext(hostname string, method string, p string, body io.Reader, data interface{}) (string, error) {
114 opts := clientOptions(hostname, c.http.Transport)

Callers

nothing calls this directly

Calls 3

clientOptionsFunction · 0.85
handleResponseFunction · 0.85
DoMethod · 0.65

Tested by

no test coverage detected