Ejemplo n.º 1
0
        public HttpWebResponse ProcessRecord(HttpRequestRecord record, CookieCollection cookies)
        {
            HttpRequestClient client = new HttpRequestClient(record.Uri, record.RequestHeaders, cookies);

            NameValueCollection postData = record.PostData;

            foreach (string key in postData)
            {
                client.AddData(key, postData[key]);
            }

            if (record.Method == "POST")
            {
                if (record.ContentType == "application/json")
                {
                    return(client.PostJson(record.RequestContent));
                }

                return(client.PostUrlEncoded());
            }
            else
            {
                return(client.GetWebResponse());
            }
        }
Ejemplo n.º 2
0
 public HttpRequestProcessedResult(HttpRequestRecord httpRequestRecord, bool success, double elsapsedMilliSeconds, HttpStatusCode?httpResponseStatusCode, Exception exception = null, WebExceptionStatus?webExceptionStatus = null)
 {
     HttpRequestRecord      = httpRequestRecord;
     Success                = success;
     ElapsedMilliseconds    = elsapsedMilliSeconds;
     HttpResponseStatusCode = httpResponseStatusCode;
     Exception              = exception;
     ExceptionStatus        = webExceptionStatus;
 }
Ejemplo n.º 3
0
        public HttpRequestWorker(HttpRequestRecord record, int sleepTime, int firstRunDelay)
        {
            m_Record        = record;
            m_FirstRunDelay = firstRunDelay;
            m_HttpRequestRecordProcessor = new HttpRequestRecordProcessor();
            m_CookieCollection           = new CookieCollection();

            SucceessCount     = 0;
            FailCount         = 0;
            TotalCount        = 0;
            TotalMilliSeconds = 0;
            IsRunning         = false;
            SleepTime         = sleepTime;
        }
Ejemplo n.º 4
0
 public HttpRequestWorker(HttpRequestRecord record, int sleepTime)
     : this(record, sleepTime, 0)
 {
 }
Ejemplo n.º 5
0
 public HttpRequestWorker(HttpRequestRecord record)
     : this(record, 10)
 {
 }