Request sends an authenticated request to the CredHub server. The pathStr should include the full path (eg. /api/v1/data). The request body should be marshallable to JSON, but can be left nil for GET requests. Request() is used by other CredHub client methods to send authenticated requests to the
(method string, pathStr string, query url.Values, body interface{}, checkServerErr bool)
| 22 | // Use Request() directly to send authenticated requests to the CredHub server. |
| 23 | // For unauthenticated requests (eg. /health), use Config.Client() instead. |
| 24 | func (ch *CredHub) Request(method string, pathStr string, query url.Values, body interface{}, checkServerErr bool) (*http.Response, error) { |
| 25 | return ch.request(ch.Auth, method, pathStr, query, body, checkServerErr) |
| 26 | } |
| 27 | |
| 28 | type requester interface { |
| 29 | Do(req *http.Request) (*http.Response, error) |