HasVerb() public static method

public static HasVerb ( string httpVerb ) : bool
httpVerb string
return bool
Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
        public Task <TResponse> CustomMethodAsync <TResponse>(string httpVerb, string relativeOrAbsoluteUrl, object request)
        {
            if (!HttpMethods.HasVerb(httpVerb))
            {
                throw new NotSupportedException("Unknown HTTP Method is not supported: " + httpVerb);
            }

            var requestBody = httpVerb.HasRequestBody() ? request : null;

            return(SendAsync <TResponse>(httpVerb, GetBaseUrl(relativeOrAbsoluteUrl), requestBody));
        }
Ejemplo n.º 3
0
        public Task CustomMethodAsync(string httpVerb, IReturnVoid requestDto)
        {
            if (!HttpMethods.HasVerb(httpVerb))
            {
                throw new NotSupportedException("Unknown HTTP Method is not supported: " + httpVerb);
            }

            var requestBody = httpVerb.HasRequestBody() ? requestDto : null;

            return(SendAsync <byte[]>(httpVerb, GetBaseUrl(requestDto.ToUrl(httpVerb, Format)), requestBody));
        }
Ejemplo n.º 4
0
        public Task <TResponse> CustomMethodAsync <TResponse>(string httpVerb, object requestDto)
        {
            if (!HttpMethods.HasVerb(httpVerb))
            {
                throw new NotSupportedException("Unknown HTTP Method is not supported: " + httpVerb);
            }

            var requestBody = httpVerb.HasRequestBody() ? requestDto : null;

            return(SendAsync <TResponse>(httpVerb, ResolveTypedUrl(httpVerb, requestDto), requestBody));
        }