public async Task <bool> CheckValidRaindrop(string hydroAddressId) { string path = "/authenticate?hydroAddressId=" + hydroAddressId; StringContent content = new StringContent(BaseParameters.ToString(), Encoding.UTF8); HttpResponseMessage response = await httpClient.PostAsync(path, content).ConfigureAwait(false); string responseString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return(responseString == "true" ? true : false); }
public async Task <string> RegisterAddress(string address) { string path = "/whitelist/{0}" + address; StringContent content = new StringContent(BaseParameters.ToString(), Encoding.UTF8); HttpResponseMessage response = await httpClient.PostAsync(path, content).ConfigureAwait(false); string hydroAddressId = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return(hydroAddressId); }
public async Task <RaindropDetails> RequestRaindrop(string hydroAddressId) { string path = "/challenge?hydroAddressId=" + hydroAddressId; StringContent content = new StringContent(BaseParameters.ToString(), Encoding.UTF8); HttpResponseMessage response = await httpClient.PostAsync(path, content).ConfigureAwait(false); string responseString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); RaindropDetails details = JsonConvert.DeserializeObject <RaindropDetails>(responseString); return(details); }