Fiddler保存Response body

发布于 2020-06-16  733 次阅读


static function OnDone(oSession: Session) {
var fileName="";
var fileIndex = oSession.RequestHeaders.RequestPath.LastIndexOf ("/");
if (fileIndex > 0)
{
fileName = oSession.RequestHeaders.RequestPath.Substring (fileIndex+1);
}
if (String.IsNullOrEmpty(fileName))
{
fileName = Guid.NewGuid().ToString();
}
var saveDir="H:\\test\\";
if (!System.IO.Directory.Exists(saveDir))
{
System.IO.Directory.CreateDirectory(saveDir);
}
oSession.SaveResponseBody(saveDir + fileName);
}

医学生