Splunk REST API POST路线投掷无法执行行动。没有目标名称可以对.NET核心作用
我正在尝试使用Splunk Rest API(“ noreferrer”> https://docs.splunk.com/documentation/splunk/8.2.5/restref/restaccess#authorization.2froles )。该路线使用Postman完美地工作,但是当我尝试使用.NET Core使用IservClient进行相同的路线时,我会在没有目标名称上行动的“无法执行操作”。请让我知道我还能提供哪些信息。一直在Google上搜索错误和Splunk文档中,没有运气。
using (var client = _serviceClientFactory.GetServiceClient()) //client service factory returns a ServiceClient
{
PostRoleRequest request = new PostRoleRequest
{
name = Const.DefaultRoleName //this is the only required param
};
var response = await client.PostAsync<PostRoleResponse>($"/services/authorization/roles?output_mode=json", request);
}
public class PostRoleRequest
{
public string name { get; set; }
}
I am trying to create a role using splunk REST API (https://docs.splunk.com/Documentation/Splunk/8.2.5/RESTREF/RESTaccess#authorization.2Froles). The route works perfectly using postman, but when I try to invoke the same route using IServiceClient via .net core, I run in to "Cannot perform action "POST" without a target name to act on". Please let me know what other information I can provide. Have been searching on google for the error and in splunk documentation with no luck.
using (var client = _serviceClientFactory.GetServiceClient()) //client service factory returns a ServiceClient
{
PostRoleRequest request = new PostRoleRequest
{
name = Const.DefaultRoleName //this is the only required param
};
var response = await client.PostAsync<PostRoleResponse>(quot;/services/authorization/roles?output_mode=json", request);
}
public class PostRoleRequest
{
public string name { get; set; }
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论