crc-org / tray-windows

CodeReady Containers tray for windows
Apache License 2.0
2 stars 4 forks source link

Issue #124 Use the new config api with http methods #125

Closed anjannath closed 3 years ago

anjannath commented 3 years ago

The config api was changed to differentiate requests based on the http method rather then uri this commit changes the tray to use the new api

gbraad commented 3 years ago

Cleanup that remains:

        private static HttpRequestMessage prepareRequest(HttpMethod method, string uri, string content)
        {
            return new HttpRequestMessage
            {
                Content = new StringContent(content, Encoding.UTF8, "application/json"),
                Method = method,
                RequestUri = new Uri(uri, UriKind.RelativeOrAbsolute)
            };
        }

        private static HttpRequestMessage prepareRequest(HttpMethod method, string uri)
        {
            return  new HttpRequestMessage
            {
                Method = method,
                RequestUri = new Uri(uri, UriKind.RelativeOrAbsolute)
            };
        }

like

        private static HttpRequestMessage prepareRequest(HttpMethod method, string uri, string content = null)
        {
            return new HttpRequestMessage
            {
                Content = content == null ? null : new StringContent(content, Encoding.UTF8, "application/json"),
                Method = method,
                RequestUri = new Uri(uri, UriKind.RelativeOrAbsolute)
            };
        }

or so....