Esempio n. 1
0
 /// <summary>
 /// Checks web request method type
 /// </summary>
 public static bool IsMethod(string method, DefaultMethods methodType)
 {
     if (method == null) return false;
     string t = methodType.ToString().ToLower();
     if (method.Trim().ToLower() == t)
         return true;
     else
         return false;
 }
Esempio n. 2
0
        /// <summary>
        /// Checks web request method type
        /// </summary>
        public static bool IsMethod(string method, DefaultMethods methodType)
        {
            if (method == null)
            {
                return(false);
            }
            string t = methodType.ToString().ToLower();

            if (method.Trim().ToLower() == t)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
        public static string ValidateMethod(string method, DefaultMethods defaultMethod)
        {
            if (method == null)
            {
                return(method);
            }
            string testMethod = method.Trim().ToUpper();

            if (testMethod == GET)
            {
                return(method);
            }
            else if (testMethod == POST)
            {
                return(method);
            }
            else if (testMethod == PUT)
            {
                return(method);
            }
            else if (testMethod == DELETE)
            {
                return(method);
            }
            else if (testMethod == TRACE)
            {
                return(method);
            }
            else if (testMethod == CONNECT)
            {
                return(method);
            }
            else if (testMethod == OPTIONS)
            {
                return(method);
            }
            else
            {
                return(defaultMethod.ToString());
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Detects method by starting characters
        /// </summary>
        public static string DetectMethod(string method, DefaultMethods defaultMethods)
        {
            if (method == null)
            {
                return(method);
            }
            string testMethod = method.Trim().ToUpper();

            if (GET.StartsWith(testMethod))
            {
                return(GET);
            }
            else if (POST.StartsWith(testMethod))
            {
                return(POST);
            }
            else if (PUT.StartsWith(testMethod))
            {
                return(PUT);
            }
            else if (DELETE.StartsWith(testMethod))
            {
                return(DELETE);
            }
            else if (TRACE.StartsWith(testMethod))
            {
                return(TRACE);
            }
            else if (CONNECT.StartsWith(testMethod))
            {
                return(CONNECT);
            }
            else if (OPTIONS.StartsWith(testMethod))
            {
                return(OPTIONS);
            }
            else
            {
                return(defaultMethods.ToString());
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Detects method by starting characters
        /// </summary>
        public static string DetectMethod(string method, DefaultMethods defaultMethods)
        {
            if (method == null) return method;
            string testMethod = method.Trim().ToUpper();

            if (GET.StartsWith(testMethod))
                return GET;
            else if (POST.StartsWith(testMethod))
                return POST;
            else if (PUT.StartsWith(testMethod))
                return PUT;
            else if (DELETE.StartsWith(testMethod))
                return DELETE;
            else if (TRACE.StartsWith(testMethod))
                return TRACE;
            else if (CONNECT.StartsWith(testMethod))
                return CONNECT;
            else if (OPTIONS.StartsWith(testMethod))
                return OPTIONS;
            else
                return defaultMethods.ToString();
        }
Esempio n. 6
0
		public static string ValidateMethod(string method, DefaultMethods defaultMethod)
		{
			if (method == null) return method;
			string testMethod = method.Trim().ToUpper();

			if (testMethod == GET)
				return method;
			else if (testMethod == POST)
				return method;
			else if (testMethod == PUT)
				return method;
			else if (testMethod == DELETE)
				return method;
			else if (testMethod == TRACE)
				return method;
			else if (testMethod == CONNECT)
				return method;
			else if (testMethod == OPTIONS)
				return method;
			else
				return defaultMethod.ToString();
		}