Beispiel #1
0
 internal static WebResponseObject GetResponseObject(WebResponse response, MemoryStream contentStream, ExecutionContext executionContext, bool useBasicParsing = false)
 {
     if (WebResponseHelper.IsText(response))
     {
         if (!useBasicParsing)
         {
             return(new HtmlWebResponseObject(response, contentStream, executionContext));
         }
         return(new BasicHtmlWebResponseObject(response, contentStream));
     }
     return(new WebResponseObject(response, contentStream));
 }
Beispiel #2
0
        internal static WebResponseObject GetResponseObject(HttpResponseMessage response, Stream responseStream, ExecutionContext executionContext)
        {
            WebResponseObject output;

            if (WebResponseHelper.IsText(response))
            {
                output = new BasicHtmlWebResponseObject(response, responseStream);
            }
            else
            {
                output = new WebResponseObject(response, responseStream);
            }
            return(output);
        }
Beispiel #3
0
        internal static WebResponseObject GetResponseObject(WebResponse response, Stream responseStream, ExecutionContext executionContext, bool useBasicParsing = false)
        {
            WebResponseObject output;

            if (WebResponseHelper.IsText(response))
            {
                if (!useBasicParsing)
                {
                    output = new HtmlWebResponseObject(response, responseStream, executionContext);
                }
                else
                {
                    output = new BasicHtmlWebResponseObject(response, responseStream);
                }
            }
            else
            {
                output = new WebResponseObject(response, responseStream);
            }
            return(output);
        }
        internal static WebResponseObject GetResponseObject(HttpResponseMessage response, Stream responseStream, ExecutionContext executionContext, bool useBasicParsing = false)
        {
            WebResponseObject output;

            if (WebResponseHelper.IsText(response))
            {
                output = new BasicHtmlWebResponseObject(response, responseStream);

                // TODO: This code needs to be enable after the dependency on mshtml is resolved.
                //if (useBasicParsing)
                //{
                //    output = new BasicHtmlWebResponseObject(response, responseStream);
                //}
                //else
                //{
                //    output = new HtmlWebResponseObject(response, responseStream, executionContext);
                //}
            }
            else
            {
                output = new WebResponseObject(response, responseStream);
            }
            return(output);
        }