I App für UWP schreiben, ich bin mit HttpClient()
mit Server versucht, ich habe bisherUWP Parse oder deserialisieren Httpclient Antwort
Below-Code kommunizieren
public async void POSTreq()
{
Uri requestUri = new Uri("http://www.example.com");
string myParameters = "_action=LOGIN&[email protected]&password=123456789";
json = JsonConvert.SerializeObject(myParameters);
var objClint = new System.Net.Http.HttpClient();
System.Net.Http.HttpResponseMessage respon = await objClint.PostAsync(requestUri, new StringContent(myParameters, Encoding.UTF8, "application/x-www-form-urlencoded"));
var responJsonText = await respon.Content.ReadAsStringAsync();
Debug.WriteLine(responJsonText);
}
Ich weiß nicht, wie Antwort zu konvertieren Daten auf Wörterbuch oder Listenformat
{"redirecturl":"https:\/\/www.example.com","status":"success","timestamp":1487906895,"community":"","communitystr":null,"currentworkspace":"w","schemarevision":null,"persona":null,"username":"[email protected]","isadmin":"false","email1status":null}
Above Zeichenfolge sollte
wandeln 0output['redirecturl']="https:/\/\www.example.com"
output['status']="success" etc..
Als ein Kommentar nur daran denken, Netzwerkausnahmen zu behandeln – Corcus