// Copy constructor
 public DefaultHttpRequest(IHttpRequest existingRequest, Uri overrideUri = null)
 {
     this.body = existingRequest.Body;
     this.bodyContentType = existingRequest.BodyContentType;
     this.headers = new HttpHeaders(existingRequest.Headers);
     this.method = existingRequest.Method.Clone();
     this.canonicalUri = new CanonicalUri(existingRequest.CanonicalUri, overrideResourcePath: overrideUri);
 }
        public DefaultHttpRequest(HttpMethod method, CanonicalUri canonicalUri, QueryString queryParams, HttpHeaders headers, string body, string bodyContentType)
        {
            this.method = method;
            this.canonicalUri = canonicalUri;

            bool queryParamsWerePassed = queryParams?.Any() ?? false;
            if (queryParamsWerePassed)
            {
                var mergedQueryString = this.canonicalUri.QueryString.Merge(queryParams);
                this.canonicalUri = new CanonicalUri(this.canonicalUri.ResourcePath.ToString(), mergedQueryString);
            }

            this.headers = headers;
            if (headers == null)
            {
                this.headers = new HttpHeaders();
            }

            this.body = body;
            this.bodyContentType = bodyContentType;
        }
 public DefaultHttpRequest(HttpMethod method, CanonicalUri canonicalUri)
     : this(method, canonicalUri, null, null, null, null)
 {
 }
 private static string CreateKey(HttpMethod method, string url)
     => $"{method} {url}";
 protected override bool IsSupported(HttpMethod method)
     => SupportedMethods.Contains(method);
 IHttpRequestBuilder IHttpRequestBuilder.WithMethod(string methodName)
 {
     this.method = HttpMethod.Parse(methodName);
     return this;
 }
 IHttpRequestBuilder IHttpRequestBuilder.WithMethod(HttpMethod method)
 {
     this.method = method;
     return this;
 }
 protected abstract bool IsSupported(HttpMethod method);