This example is outdated, you can check out the many other new examples in this category.This sample project shows how to login to the Server with user name and password. For this purpose you can use the login REST command. As parameters, you need to specify the user name (Email) and password. These parameters can be passed in the HTTP request header:
#region Login
url = "http://localhost:40010/1/login";

var request = WebRequest.Create(url);
request.Headers.Add("x-sti-UserName", "1@1.com";);
request.Headers.Add("x-sti-Password", "111111");

var stream = request.GetResponse().GetResponseStream();
var sr = new StreamReader(stream);
string Out = sr.ReadToEnd();
sr.Close();
var json = JObject.Parse(Out);
// Get session key
var sessionKey = (string)json["ResultSessionKey"];
#endregion
By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.