Web Api2项目,,,Controller继承自另一个控制器,,,,需要获取json格式的每个请求和响应的body和head
try to intercept the request using the DelegatingHanler
something like the following
public class IntercepterMessageHandler : DelegatingHandler
{
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
//try to manipulate the request object
return base.SendAsync(request, cancellationToken);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.