Example #1
0
        /// <summary>
        /// Returns the request method taking X-Http-Method-Override into account.
        /// </summary>
        /// <param name="request">The request to get the method for</param>
        /// <returns>The request method</returns>
        private static string GetHttpMethod(RequestAdapter request)
        {
            var method = request.GetHeader(HeaderConstants.XHttpMethodOveride);

            if (string.IsNullOrWhiteSpace(method))
            {
                method = request.Method;
            }

            return(method.ToLower());
        }
Example #2
0
 private static long GetUploadLength(RequestAdapter request)
 {
     return(request.Headers.ContainsKey(HeaderConstants.UploadDeferLength)
         ? -1
         : long.Parse(request.GetHeader(HeaderConstants.UploadLength) ?? "-1"));
 }