示例#1
0
        public RestRequest RemoveQueryStringData(string key)
        {
            if (QueryString.Any(t => t.Key == key))
            {
                QueryString.Remove(QueryString.FirstOrDefault(t => t.Key == key));
            }

            return(this);
        }
示例#2
0
        public RestRequest SetQueryStringValue(string key, string value)
        {
            if (!string.IsNullOrEmpty(key))
            {
                var qs = QueryString.FirstOrDefault(t => t.Key == key);
                QueryString.Remove(qs);

                QueryString.Add(new KeyValuePair <string, string>(key, HttpUtility.UrlEncode(value)));
            }
            return(this);
        }