internal Response(Fiddler.Session Sess) { this.headers = new ResponseHeaderParameters(this); try { this.ID = Int32.Parse(Sess.oFlags["IronFlag-ID"]); } catch { this.ID = 0; } if (Sess.oFlags.ContainsKey("IronFlag-TTL")) { this.TTL = Int32.Parse(Sess.oFlags["IronFlag-TTL"]); } if (Sess.oFlags.ContainsKey("IronFlag-SslError")) { this.isSSlValid = false; } if (Sess.oFlags.ContainsKey("IronFlag-BuiltBy")) { this.Source = Sess.oFlags["IronFlag-BuiltBy"]; } this.httpVersion = Sess.oResponse.headers.HTTPVersion; this.code = Sess.oResponse.headers.HTTPResponseCode; try { if (Sess.oResponse.headers.HTTPResponseStatus.IndexOf(' ') > -1) { this.status = Sess.oResponse.headers.HTTPResponseStatus.Substring(Sess.oResponse.headers.HTTPResponseStatus.IndexOf(' ')).Trim(); } else { this.status = ""; } } catch (Exception Exp) { Tools.Trace("Response.cs", "Invalid Fiddler Session Response Status - " + Sess.oResponse.headers.HTTPResponseStatus); throw (Exp); } Fiddler.HTTPResponseHeaders ResHeaders = new Fiddler.HTTPResponseHeaders(); foreach (Fiddler.HTTPHeaderItem HHI in Sess.oResponse.headers) { this.Headers.Add(HHI.Name, HHI.Value); } if (Sess.responseBodyBytes.Length > 0) { this.SetBody(Sess.responseBodyBytes); } }
/// <summary> /// devleuve las cookies de manera amigable para imprimir /// </summary> /// <param name="hTTPResponseHeaders"></param> /// <returns></returns> internal static string GetCookiesFriendly(Fiddler.HTTPResponseHeaders hTTPResponseHeaders) { var result = "Received Cookies= "; foreach (Fiddler.HTTPHeaderItem item in hTTPResponseHeaders) { if (item.Name.ToLower().Contains("set-cookie")) { result += item.Value; } } return(OpenSTAUtils.SplitCommentIfNecesary(result)); }
internal Response(Fiddler.Session Sess) { this.headers = new ResponseHeaderParameters(this); try { this.ID = Int32.Parse(Sess.oFlags["IronFlag-ID"]); } catch { this.ID = 0; } if (Sess.oFlags.ContainsKey("IronFlag-TTL")) { this.TTL = Int32.Parse(Sess.oFlags["IronFlag-TTL"]); } if (Sess.oFlags.ContainsKey("IronFlag-SslError")) { this.isSSlValid = false; } if (Sess.oFlags.ContainsKey("IronFlag-BuiltBy")) { this.Source = Sess.oFlags["IronFlag-BuiltBy"]; } this.httpVersion = Sess.oResponse.headers.HTTPVersion; this.code = Sess.oResponse.headers.HTTPResponseCode; try { if (Sess.oResponse.headers.HTTPResponseStatus.IndexOf(' ') > -1) this.status = Sess.oResponse.headers.HTTPResponseStatus.Substring(Sess.oResponse.headers.HTTPResponseStatus.IndexOf(' ')).Trim(); else this.status = ""; } catch(Exception Exp) { Tools.Trace("Response.cs", "Invalid Fiddler Session Response Status - " + Sess.oResponse.headers.HTTPResponseStatus); throw (Exp); } Fiddler.HTTPResponseHeaders ResHeaders = new Fiddler.HTTPResponseHeaders(); foreach (Fiddler.HTTPHeaderItem HHI in Sess.oResponse.headers) { this.Headers.Add(HHI.Name, HHI.Value); } if (Sess.responseBodyBytes.Length > 0) { this.SetBody(Sess.responseBodyBytes); } }