安装插件
设置
查看文档
http://127.0.0.1:9090/plugin-admin.jsp?plugin=userservice&showReadme=true&decorator=none
代码示例
string url = "http://127.0.0.1:9090/plugins/userService/users";
WebRequest req = WebRequest.Create(url);
string username = "admin";
string password = "admin";
string usernamePassword = username + ":" + password;
CredentialCache mycache = new CredentialCache();
mycache.Add(new Uri(url), "Basic", new NetworkCredential(username, password));
req.Credentials = mycache;
req.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(new ASCIIEncoding().GetBytes(usernamePassword)));
WebResponse result = null;
try
{
result = req.GetResponse();
Stream ReceiveStream = result.GetResponseStream();
//read the stream into a string
StreamReader sr = new StreamReader(ReceiveStream);
string resultstring = sr.ReadToEnd();
}
catch (Exception exp)
{
Console.WriteLine(exp.Message);
}
finally
{
if (result != null)
{
result.Close();
}
}