You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
789 B
C#
30 lines
789 B
C#
using RestSharp;
|
|
using RestSharp.Extensions;
|
|
using RestSharp.Serializers;
|
|
using RestSharp.Authenticators;
|
|
|
|
using System.Security.Cryptography.X509Certificates;
|
|
using System.Net;
|
|
|
|
namespace ElasticSearchStudy.App
|
|
{
|
|
internal class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
Console.WriteLine("使用 ElistcSearch WebApi");
|
|
|
|
var option = new RestClientOptions()
|
|
{
|
|
BaseUrl = new Uri("https://localhost:9200"),
|
|
Authenticator = new HttpBasicAuthenticator("elastic", "jLAglHZ1Wvt9ikOjb2TY")
|
|
|
|
};
|
|
|
|
var restClient = new RestClient(option);
|
|
var request = new RestRequest("/_cluster/health", Method.Get);
|
|
|
|
var dd = restClient.Get(request);
|
|
}
|
|
}
|
|
} |