public PostData <L, E> GetPostData(string url, HttpTools tools) { HttpWebResponse res = Response(url, tools); if (res != null) { string json = DataSwitch.GetResponseString(res); PostData <L, E> postData = DataSwitch.JsonToObj <PostData <L, E> >(json); if (postData == null) { return(new PostData <L, E>()); } return(postData); } return(new PostData <L, E>()); }
public E GetEntity(string url, HttpTools tools) { HttpWebResponse res = Response(url, tools); if (res != null) { string json = DataSwitch.GetResponseString(res); PostData <DBNull, E> postData = DataSwitch.JsonToObj <PostData <DBNull, E> >(json); if (postData == null) { return(new E()); } return(postData.Entity); } return(new E()); }
public string GetMsg(string url, HttpTools tools) { HttpWebResponse res = Response(url, tools); if (res != null) { string json = DataSwitch.GetResponseString(res); PostData <DBNull, DBNull> postData = DataSwitch.JsonToObj <PostData <DBNull, DBNull> >(json); if (postData == null) { return(""); } return(postData.Msg); } return(""); }
public List <L> GetList(string url, HttpTools tools) { HttpWebResponse res = Response(url, tools); if (res != null) { string json = DataSwitch.GetResponseString(res); PostData <L, DBNull> postData = DataSwitch.JsonToObj <PostData <L, DBNull> >(json); if (postData == null) { return(new List <L>()); } return(postData.DList); } return(new List <L>()); }