public void AddUrlParameter(string key, string value) { CoreValidator.TrowIfNullOrEmpty(key, nameof(key)); CoreValidator.TrowIfNullOrEmpty(value, nameof(value)); this.UrlParameters[key] = value; }
public RedirectResponse(string redirectUrl) { CoreValidator.TrowIfNullOrEmpty(redirectUrl, nameof(redirectUrl)); this.StatusCode = HttpStatusCode.Found; this.Headers.Add(new HttpHeader("Location", redirectUrl)); }
public HttpHeader(string key, string value) { CoreValidator.TrowIfNullOrEmpty(key, nameof(key)); CoreValidator.TrowIfNullOrEmpty(value, nameof(value)); this.Key = key; this.Value = value; }
public HttpRequest(string requestText) { CoreValidator.TrowIfNullOrEmpty(requestText, nameof(requestText)); this.FormData = new Dictionary <string, string>(); this.QueryParameters = new Dictionary <string, string>(); this.UrlParameters = new Dictionary <string, string>(); this.Headers = new HttpHeaderCollection(); this.ParseRequest(requestText); }
public HttpHeader Get(string key) { CoreValidator.TrowIfNullOrEmpty(key, nameof(key)); if (!this.headers.ContainsKey(key)) { throw new InvalidOperationException("The given key is not present in the headers collection."); } return(this.headers[key]); }
public bool ContainsKey(string key) { CoreValidator.TrowIfNullOrEmpty(key, nameof(key)); return(this.headers.ContainsKey(key)); }