MCPcopy
hub / github.com/cloudfoundry/cli / Make

Method Make

api/plugin/plugin_connection.go:41–60  ·  view source on GitHub ↗

Make performs the request and parses the response.

(request *http.Request, passedResponse *Response, proxyReader ProxyReader)

Source from the content-addressed store, hash-verified

39
40// Make performs the request and parses the response.
41func (connection *PluginConnection) Make(request *http.Request, passedResponse *Response, proxyReader ProxyReader) error {
42 // In case this function is called from a retry, passedResponse may already
43 // be populated with a previous response. We reset in case there's an HTTP
44 // error and we don't repopulate it in populateResponse.
45 passedResponse.reset()
46
47 response, err := connection.HTTPClient.Do(request)
48 if err != nil {
49 return connection.processRequestErrors(request, err)
50 }
51
52 body := response.Body
53 if proxyReader != nil {
54 proxyReader.Start(response.ContentLength)
55 defer proxyReader.Finish()
56 body = proxyReader.Wrap(response.Body)
57 }
58
59 return connection.populateResponse(response, passedResponse, body)
60}
61
62func (*PluginConnection) handleStatusCodes(response *http.Response, passedResponse *Response) error {
63 if response.StatusCode >= 400 {

Callers

nothing calls this directly

Calls 7

processRequestErrorsMethod · 0.95
populateResponseMethod · 0.95
DoMethod · 0.65
StartMethod · 0.65
FinishMethod · 0.65
WrapMethod · 0.65
resetMethod · 0.45

Tested by

no test coverage detected