public User AttendBase(string url)
{
using (var client = new WebClient())
{
client.Headers[HttpRequestHeader.ContentType] = "application/json";
client.Headers[HttpRequestHeader.ContentEncoding] = "utf-8";
try
{
User user = new User();
string response = client.UploadString(url, "POST", "");
var result = DynamicJson.Parse(response);
user.Sid = result["sid"];
user.Name = result["name"];
return user;
}
catch (WebException e)
{
Log.Write(e.Status.ToString());
Console.WriteLine(e.Source);
throw new NullReferenceException();
}
}
}