I wrote Azure Function in C#. This function must send request to external API with many params. It looks like this:
using (var client = new HttpClient())
{
var url = new Uri ("http://externalapi/data/save");
var response = await client.GetAsync(url + string.Format("?param1={0}¶m2={1}&level={2}&dt_event={3}&DeviceId={4}&Apid={5}",humidity, temperature, level, data.dateTime, data.deviceId, data.apid));
var content = await response.Content.ReadAsStringAsync();
// log.LogInformation("Message displayed: {content}", content);
}
I have question related with GetAsync line. Is it possible to write it in a more transparent way than I wrote it? I've seen many solutions, but I've done the same as mine.
Of course, this solution works, but I would like to write it in a more optimal way.