Example #1
0
        internal static void EnhanceEntity(HttpEntityEnclosingRequest request)
        {
            HttpEntity entity = request.GetEntity();

            if (entity != null && !entity.IsRepeatable() && !IsEnhanced(entity))
            {
                HttpEntity proxy = (HttpEntity)Proxy.NewProxyInstance(typeof(HttpEntity).GetClassLoader
                                                                          (), new Type[] { typeof(HttpEntity) }, new RequestEntityExecHandler(entity));
                request.SetEntity(proxy);
            }
        }
Example #2
0
        /// <exception cref="Org.Apache.Http.HttpException"></exception>
        /// <exception cref="System.IO.IOException"></exception>
        public virtual void SendRequestEntity(HttpEntityEnclosingRequest request)
        {
            Args.NotNull(request, "HTTP request");
            EnsureOpen();
            HttpEntity entity = request.GetEntity();

            if (entity == null)
            {
                return;
            }
            OutputStream outstream = PrepareOutput(request);

            entity.WriteTo(outstream);
            outstream.Close();
        }
 /// <exception cref="Apache.Http.ProtocolException"></exception>
 public EntityEnclosingRequestWrapper(HttpEntityEnclosingRequest request) : base(request
                                                                                 )
 {
     // e.g. [gs]etEntity()
     SetEntity(request.GetEntity());
 }
 public HttpEntityEnclosingRequestWrapper(HttpEntityEnclosingRequest request) : base
         (request)
 {
     this.entity = request.GetEntity();
 }