初始化
This commit is contained in:
25
BooliveMQTT_Auth/Common/HttpRequest.cs
Normal file
25
BooliveMQTT_Auth/Common/HttpRequest.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using RestSharp;
|
||||
|
||||
namespace IotManager.Common
|
||||
{
|
||||
public class HttpRequest
|
||||
{
|
||||
public static string BaseUrl = "";
|
||||
public bool SendHttpRequest(string Url,List<string> paramlist)
|
||||
{
|
||||
var options = new RestClientOptions(BaseUrl);
|
||||
var client = new RestClient(options);
|
||||
|
||||
var request = new RestRequest("api/login/Helloooo");
|
||||
request.AddParameter("key", "j76R2968V^aw%2;2");
|
||||
|
||||
RestResponse response = client.ExecutePost(request);
|
||||
string? allow_or_deny = response.Content;
|
||||
if (allow_or_deny.Equals("allow"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user