I am creating a Windows Store application, but I am fixated on receiving a UTF-8 response from the API.
This is the code:
using (HttpClient client = new HttpClient()) { Uri url = new Uri(BaseUrl + "/me/lists"); HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, url); request.Headers.Add("Accept", "application/json"); HttpResponseMessage response = await client.SendRequestAsync(request); response.EnsureSuccessStatusCode(); string responseString = await response.Content.ReadAsStringAsync(); response.Dispose(); }
reponseString always contains strange characters that should be like Γ©, and I tried to use a stream, but the API that I found in some examples does not exist on Windows RT.
edit: improved code, another problem
Samueldebruyn
source share