初始化CRICS
This commit is contained in:
39
CommonEntity/HiWei.cs
Normal file
39
CommonEntity/HiWei.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using RestSharp;
|
||||
using System.Net;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class HiWei
|
||||
{
|
||||
public static string BaseUrl = "tvos.hw-iot.com.cn";
|
||||
public void Login()
|
||||
{
|
||||
try
|
||||
{
|
||||
var client1 = new RestClient(BaseUrl);
|
||||
var request1 = new RestRequest("/api/security/authenticate", Method.POST);
|
||||
|
||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||
User us = new User();
|
||||
us.username = "";
|
||||
us.password = "";
|
||||
us.oauth_id = 1;
|
||||
request1.AddJsonBody(us);
|
||||
|
||||
var QQQ = client1.Execute(request1);
|
||||
HttpStatusCode HHH = QQQ.StatusCode;
|
||||
if (HHH == HttpStatusCode.Created||HHH==HttpStatusCode.OK)
|
||||
{
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user