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

Method REST

api/client.go:157–164  ·  view source on GitHub ↗

REST performs a REST request and parses the response.

(hostname string, method string, p string, body io.Reader, data any)

Source from the content-addressed store, hash-verified

155
156// REST performs a REST request and parses the response.
157func (c Client) REST(hostname string, method string, p string, body io.Reader, data any) error {
158 opts := clientOptions(hostname, c.http.Transport)
159 restClient, err := ghAPI.NewRESTClient(opts)
160 if err != nil {
161 return err
162 }
163 return handleResponse(restClient.Do(method, p, body, data))
164}
165
166func (c Client) RESTWithNext(hostname string, method string, p string, body io.Reader, data any) (string, error) {
167 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