| | |
| | | { |
| | | //服务返回来没有门锁成员信息,没有必要再去请求成员列表, |
| | | //原因:节约时间,体验效果好; |
| | | result = await UserCenter.UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra); |
| | | result = UserCenter.UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra); |
| | | }
|
| | | if (string.IsNullOrEmpty(result))
|
| | | {
|
| | |
| | | /// <param name="method">请求方式为POST/GET</param> |
| | | /// <param name="second">超时时间</param> |
| | | /// <returns></returns> |
| | | public static async System.Threading.Tasks.Task<string> HttpWebRequest(string getUrl, string str, string method, int second = 3) |
| | | public static async System.Threading.Tasks.Task<string> HttpWebRequest(string getUrl, string str, string method, int second = 3, bool _bool = false) |
| | | { |
| | | HttpWebRequest request = WebRequest.Create(getUrl) as HttpWebRequest; //创建请求 |
| | | request.Method = method; //请求方式为POST/GET |
| | | request.ContentType = "application/json"; |
| | | request.ContentType = "application/json"; |
| | | request.Timeout = second * 1000;//超时时间 |
| | | if (_bool) { |
| | | //用于高胜可视对讲接口 |
| | | request.Headers.Add("Authorization", Config.Instance.Token); |
| | | } |
| | | if (method == "POST") |
| | | { |
| | | byte[] jsonbyte = System.Text.Encoding.UTF8.GetBytes(str); |