using System.Net.Http;
var builder = new UriBuilder
{
Scheme = Uri.UriSchemeHttps,
Port = -1,
Host = "https://example.com",
Path = "api"
};
var query = builder.Uri.ParseQueryString();
query["name"] = "aaa";
query["key"] = "123-456";
builder.Query = query.ToString();
var stringUri = builder.ToString();
// https://example.com/api?name=aaa&key=123-456
HttpClient client = new HttpClient();
var response = await client.GetAsync(stringUri);