client-go/rest: move content type wiring from client to request

Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: fe1eda0649fdb6a15200d279be214c67246d3b12
This commit is contained in:
Monis Khan
2024-08-18 15:01:57 -04:00
committed by Kubernetes Publisher
parent c5146a9031
commit 1647efd5c4
4 changed files with 70 additions and 64 deletions

View File

@@ -105,10 +105,6 @@ type RESTClient struct {
// NewRESTClient creates a new RESTClient. This client performs generic REST functions
// such as Get, Put, Post, and Delete on specified paths.
func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ClientContentConfig, rateLimiter flowcontrol.RateLimiter, client *http.Client) (*RESTClient, error) {
if len(config.ContentType) == 0 {
config.ContentType = "application/json"
}
base := *baseURL
if !strings.HasSuffix(base.Path, "/") {
base.Path += "/"