本文整理汇总了C#中HttpRequest.AddQueryParameter方法的典型用法代码示例。如果您正苦于以下问题:C# HttpRequest.AddQueryParameter方法的具体用法?C# HttpRequest.AddQueryParameter怎么用?C# HttpRequest.AddQueryParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpRequest
的用法示例。
在下文中一共展示了HttpRequest.AddQueryParameter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
public Task Delete(JwtCredentials credentials)
{
var request = new HttpRequest<dynamic>("/consumers/{consumerId}/jwt/{credentialId}", HttpMethods.Delete);
request.AddQueryParameter("consumerId", _consumer.Id);
request.AddQueryParameter("credentialId", credentials.Id);
return ExecuteAsync(request);
}
示例2: Patch
public Task Patch(JwtCredentials credentials)
{
var request = new HttpRequest<KongCollection<JwtCredentials>>("/consumers/{consumerId}/jwt/{credentialId}", HttpMethods.Patch)
{
Data = credentials
};
request.AddQueryParameter("consumerId", _consumer.Id);
request.AddQueryParameter("credentialId", credentials.Id);
return ExecuteAsync(request);
}
示例3: List
public async Task<IKongCollection<JwtCredentials>> List()
{
var request = new HttpRequest<KongCollection<JwtCredentials>>("/consumers/{consumerId}/jwt", HttpMethods.Get);
request.AddQueryParameter("consumerId", _consumer.Id);
var response = await ExecuteAsync(request);
return response;
}
示例4: CreateCredentials
private Task<JwtCredentials> CreateCredentials(object data)
{
var request = new HttpRequest<JwtCredentials>("/consumers/{consumerId}/jwt", HttpMethods.Post)
{
Data = data
};
request.AddQueryParameter("consumerId", _consumer.Id);
return ExecuteAsync(request);
}
示例5: CreateCredentials
public Task CreateCredentials(string username, string password)
{
var request = new HttpRequest<dynamic>("/consumers/{consumerId}/basic-auth", HttpMethods.Post)
{
Data = new
{
username,
password
}
};
request.AddQueryParameter("consumerId", _consumer.Id);
return ExecuteAsync(request);
}
示例6: CreateCredentials
public Task CreateCredentials(string key)
{
var request = new HttpRequest<dynamic>("/consumers/{consumerId}/key-auth", HttpMethods.Post)
{
Data = new
{
key,
consumer_id = _consumer.Id
}
};
request.AddQueryParameter("consumerId", _consumer.Id);
return ExecuteAsync(request);
}