Hello I'm very new to networking and I'm wondering if anyone knows how I might get at the LoginResult from a successful login using System.net HttpClient?
StringContent queryString = new StringContent( JsonConvert.SerializeObject(request), Encoding.UTF8, "application/json");
string emailurl = "https://titleId.playfabapi.com/Client/LoginWithEmailAddress";
var response = await client.PostAsync(emailurl,queryString);
var responseBody = await response.Content.ReadAsStringAsync();
LoginResult loginresult = JsonConvert.DeserializeObject{LoginResult}(responseBody);
if (response.IsSuccessStatusCode)
{
Debug.WriteLine("http success: " + responseBody);
Debug.WriteLine("Session ticket: " + result.SessionTicket);
OnLoginSuccess(loginresult);
}
http success: {"code":200,"status":"OK","data":{"SessionTicket":"653F511587887FAB.......
Session ticket:
^The problem is LoginResult does not deserialize properly (all the fields, such as session ticket, are empty) and I don't know how to get the sessionTicket from code. And I need to sessionTicket to get user data.
^I believe "data" is the actual LoginResult that I'm looking for. But I don't know what the type of what I'm actually getting is?