Esempio n. 1
0
        /// <summary>
        /// Checks whether the HTTP method is supported by this library or not.
        /// </summary>
        /// <param name="method"><see cref="HttpMethod"/> instance.</param>
        /// <returns>Returns <c>True</c>, if supported; otherwise returns <c>False</c>.</returns>
        internal static bool IsSupported(this HttpMethod method)
        {
            method.ThrowIfNullOrDefault();

            if (method == HttpMethod.Get)
            {
                return(true);
            }

            if (method == HttpMethod.Post)
            {
                return(true);
            }

            if (method == HttpMethod.Put)
            {
                return(true);
            }

            if (method == new HttpMethod("PATCH"))
            {
                return(true);
            }

            return(false);
        }