A UWP dashboard which provides live updates for the 'Personal Flash in Real-Time (Andy)' and 'Personal Flash in Real-Time (Tony)' artworks -- part of the 'Return to Ritherdon' project by Nicola Ellis. Documentation can be found at
https://git.abbether.net/return-to-ritherdon/rtr-docs/src/branch/master/eyes-and-ears
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
616 B
19 lines
616 B
4 years ago
|
using System.Net.Http;
|
||
|
using System.Net.Http.Headers;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
namespace EyesAndEars.UWP.Services {
|
||
|
public static class WebServices {
|
||
|
|
||
|
private static readonly HttpClient _client = new HttpClient();
|
||
|
|
||
|
public static async Task<string> GetLightReading(string url, int deviceId) {
|
||
|
_client.DefaultRequestHeaders.Accept.Clear();
|
||
|
_client.DefaultRequestHeaders.Accept.Add(
|
||
|
new MediaTypeWithQualityHeaderValue("application/json"));
|
||
|
return await _client.GetStringAsync($"{url}/api/readings/latest/{deviceId}");
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|