本文整理汇总了C#中RestRequest.AddQueryString方法的典型用法代码示例。如果您正苦于以下问题:C# RestRequest.AddQueryString方法的具体用法?C# RestRequest.AddQueryString怎么用?C# RestRequest.AddQueryString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RestRequest
的用法示例。
在下文中一共展示了RestRequest.AddQueryString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildResourceUriWhereBaseUriHasMultiplePathSegments
public void BuildResourceUriWhereBaseUriHasMultiplePathSegments()
{
var request = new RestRequest("apis");
request.AddQueryString("name", "adexchangebuyer");
Assert.AreEqual("https://www.googleapis.com/discovery/v1/apis?&name=adexchangebuyer", request.GetResourceUri("https://www.googleapis.com/discovery/v1").ToString());
}
示例2: GetApisRaw
/// <summary>
/// Gets a list of APIs that are available from Google to develop against.
/// </summary>
/// <returns>An ApiResult object containing the APIs available from Google.</returns>
public async Task<string> GetApisRaw(string name = "")
{
var request = new RestRequest("apis") { };
if (!string.IsNullOrWhiteSpace(name))
{
request.AddQueryString("name", name);
}
return await ExecuteAsync<string>(request);
}