Пример #1
0
 internal static HttpRequestResult Create(byte[] payload, string contentType = "application/unknown")
 {
     HttpRequestResult result = new HttpRequestResult();
     result._payload = payload;
     result._contentType = contentType;
     return result;
 }
Пример #2
0
 internal static HttpRequestResult Create(string response, string originalSource, string log, Encoding enc, string contentType = "application/unknown")
 {
     HttpRequestResult result = new HttpRequestResult();
     result._log = log;
     result._contentType = contentType;
     try
     {
         if (enc == null)
             enc = ExecutionSettings.DefaultEncoding;
         //TODO Call SiteBuilder.GetSite elsewhere
         result._payload = enc.GetBytes(DebugUtilsV2.Generators.SiteBuilder.GetSite(response));
     }
     catch (Exception ex)
     {
         result._log += ex.Message + Environment.NewLine;
     }
     return result;
 }