当前位置: 首页>>代码示例>>C#>>正文


C# Request.AddQueryString方法代码示例

本文整理汇总了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;
        }
开发者ID:ahardin,项目名称:easypost-csharp,代码行数:24,代码来源:Tracker.cs


注:本文中的Request.AddQueryString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。