Microsoft.Owin.Testing.TestServer不能与Fiddler一起使用
问题描述:
我尝试使用TestServer
,发现Fiddler无法捕获流量.
I tried to use TestServer
and found that Fiddler could not catch the traffic.
地址设置为http://localhost
,无法更改它.
The address is set to http://localhost
and no way to change it.
server = TestServer.Create(app =>
{
new Startup().Configuration(app);
});
将URL更改为http://ipv4.fiddler
或我该怎么办?
答
这将不起作用,因为TestServer
伪造了传输层,只是创建了HttpContext对象并将其传递给您的控制器. Fiddler不会拦截任何流量,也不会执行真正的 TCP 或 HTTP .
This won't work as TestServer
fakes out the transport layer and just creates and passes in HttpContext objects to your controllers. There's no traffic for Fiddler to intercept and no real TCP or HTTP performed.