iam trying to get all clients from my harvest account... The problem is that the password contains a §
sign. I took it away first and it worked but now my boss tells me the password cant be changed for different reasons. ive already tried utf8encoding ect.
public List<Client> GetAllClients()
{
uri = "https://laios.harvestapp.com/clients";
using (WebClient webClient = new WebClient())
{
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
webClient.Headers[HttpRequestHeader.Accept] = "application/json";
webClient.Headers[HttpRequestHeader.Authorization] = "Basic " + Convert.ToBase64String(new ASCIIEncoding().GetBytes(usernamePassword));
string response = webClient.DownloadString(uri);
clientsList = JsonConvert.DeserializeObject<List<Wrapper>>(response).Select(c => c.client).ToList();
}
}