ServiceStack.HttpMethods.HasVerb C# (CSharp) Method

HasVerb() public static method

public static HasVerb ( string httpVerb ) : bool
httpVerb string
return bool
        public static bool HasVerb(string httpVerb)
        {
#if NETFX_CORE
            return allVerbs.Any(p => p.Equals(httpVerb.ToUpper()));
#else
            return AllVerbs.Contains(httpVerb.ToUpper());
#endif
        }

Usage Example

Beispiel #1
0
        public virtual Task <TResponse> CustomMethodAsync <TResponse>(string httpVerb, object requestDto)
        {
            if (!HttpMethods.HasVerb(httpVerb))
            {
                throw new NotSupportedException("Unknown HTTP Method is not supported: " + httpVerb);
            }

            return(asyncClient.SendAsync <TResponse>(httpVerb, GetUrl(requestDto.ToUrl(httpVerb, Format)), requestDto));
        }
All Usage Examples Of ServiceStack.HttpMethods::HasVerb
HttpMethods