How can I send the parameters with GET request?
using (HttpClient client = new HttpClient())
{
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("client_id", clientId),
new KeyValuePair<string, string>("response_type", "code"),
new KeyValuePair<string, string>("redirect_uri", redirectUri),
new KeyValuePair<string, string>("state", "qwe123"),
};
HttpContent content = new FormUrlEncodedContent(queryParameters);
client.
HttpResponseMessage resp = await client.GetAsync("https://uri", content); //here is mistake
string responseBody = await resp.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
I tried to use KeyValuePair for configuring parameters. Thanks!