Пример #1
0
        public Task <TResponse> CustomMethodAsync <TResponse>(string httpVerb, string relativeOrAbsoluteUrl, object request)
        {
            if (!HttpMethods.Exists(httpVerb))
            {
                throw new NotSupportedException("Unknown HTTP Method is not supported: " + httpVerb);
            }

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

            return(SendAsync <TResponse>(httpVerb, ResolveUrl(httpVerb, relativeOrAbsoluteUrl), requestBody));
        }
Пример #2
0
        public Task CustomMethodAsync(string httpVerb, IReturnVoid requestDto)
        {
            if (!HttpMethods.Exists(httpVerb))
            {
                throw new NotSupportedException("Unknown HTTP Method is not supported: " + httpVerb);
            }

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

            return(SendAsync <byte[]>(httpVerb, ResolveTypedUrl(httpVerb, requestDto), requestBody));
        }