public RestRequest RemoveQueryStringData(string key) { if (QueryString.Any(t => t.Key == key)) { QueryString.Remove(QueryString.FirstOrDefault(t => t.Key == key)); } return(this); }
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); }