LoklakDotNet.Loklak.ProcessUrlAsync C# (CSharp) Method

ProcessUrlAsync() private method

private ProcessUrlAsync ( string method, string>.Dictionary parameters = null ) : Task
method string
parameters string>.Dictionary
return Task
        private async Task<string> ProcessUrlAsync(string method, Dictionary<string,string> parameters=null)
        {
            var uriString = apiUrl + method;
            if(method=="markdown.png" || method == "map.png")
            {
                uriString = uriString.Replace("api", "vis");
            }
            UriBuilder uri = new UriBuilder(uriString);
            if(!object.ReferenceEquals(null, parameters) && parameters.Count!=0)
            {
                uri.Query = new FormUrlEncodedContent(parameters).ReadAsStringAsync().Result;
            }
            System.Diagnostics.Debug.WriteLine(uri.Uri.AbsoluteUri);
            var result = await client.GetStringAsync(uri.Uri.AbsoluteUri);
            System.Diagnostics.Debug.WriteLine(result);
            return result;
        }