本文整理汇总了C#中Request.AddQueryString方法的典型用法代码示例。如果您正苦于以下问题:C# Request.AddQueryString方法的具体用法?C# Request.AddQueryString怎么用?C# Request.AddQueryString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request.AddQueryString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: List
/// <summary>
/// Get a paginated list of trackers.
/// </summary>
/// Optional dictionary containing parameters to filter the list with. Valid pairs:
/// * {"tracking_code", string} Tracking number string. Only retrieve trackers with the given tracking code.
/// * {"carrier", string} String representing the tracker's carrier. Only retrieve trackers with the given carrier.
/// * {"before_id", string} String representing a Tracker. Starts with "trk_". Only retrieve trackers created before this id. Takes precedence over after_id.
/// * {"after_id", string} String representing a Tracker. Starts with "trk_". Only retrieve trackers created after this id.
/// * {"start_datetime", datetime} Datetime representing the earliest possible tracker. Only retrieve trackers created at or after this datetime. Defaults to 1 month ago.
/// * {"end_datetime", datetime} Datetime representing the latest possible tracker. Only retrieve trackers created before this datetime. Defaults to the end of the current day.
/// * {"page_size", int} Size of page. Default to 30.
/// All invalid keys will be ignored.
/// <param name="parameters">
/// </param>
/// <returns>Instance of EasyPost.ShipmentList</returns>
public static TrackerList List(Dictionary<string, object> parameters = null)
{
Request request = new Request("trackers");
request.AddQueryString(parameters ?? new Dictionary<string, object>());
TrackerList trackerList = request.Execute<TrackerList>();
trackerList.filters = parameters;
return trackerList;
}