Пример #1
0
        /// <inheritdoc/>
        public HttpRequestMessage CreateRequest(Nullable <bool> overrideGZipEnabled = null)
        {
            var    builder = CreateBuilder();
            var    request = builder.CreateRequest();
            object body    = GetBody();

            request.SetRequestSerailizedContent(service, body, overrideGZipEnabled.HasValue
                ? overrideGZipEnabled.Value : service.GZipEnabled);
            AddETag(request);
            ModifyRequest?.Invoke(request);
            return(request);
        }
Пример #2
0
        /// <inheritdoc/>
        public HttpRequestMessage CreateRequest(Nullable <bool> overrideGZipEnabled = null)
        {
            var    builder = CreateBuilder();
            var    request = builder.CreateRequest();
            object body    = GetBody();

            request.SetRequestSerailizedContent(service, body, overrideGZipEnabled.HasValue
                ? overrideGZipEnabled.Value : service.GZipEnabled);
            AddETag(request);
            if (_unsuccessfulResponseHandlers != null)
            {
                request.Properties.Add(ConfigurableMessageHandler.UnsuccessfulResponseHandlerKey, _unsuccessfulResponseHandlers);
            }
            if (_exceptionHandlers != null)
            {
                request.Properties.Add(ConfigurableMessageHandler.ExceptionHandlerKey, _exceptionHandlers);
            }
            if (_executeInterceptors != null)
            {
                request.Properties.Add(ConfigurableMessageHandler.ExecuteInterceptorKey, _executeInterceptors);
            }
            ModifyRequest?.Invoke(request);
            return(request);
        }