HttPresponse和httpresponsemessage之间的区别是什么?

发布于 2025-02-08 13:32:35 字数 135 浏览 2 评论 0 原文

我正在使用ASP.NET Framework 4.8构建Web应用程序,并且在创建自己的响应类别时,我正在尝试自定义对客户的响应。

我一直在寻找如何实施它,我意识到有两个类别处理请求和响应的类是httpcontext.Response。他们?

I´m building a web application using asp.net Framework 4.8 and I´m trying to customize the response to the client when there´s an exception by creating my own Response class.

I was looking about how to implement it and I realized that there are two classes that handle the requests and responses, one of them was HttpContext.Response whose type is HttpResponse and the other was HttpResponseMessage so I was wondering, What´s the difference between them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巷子口的你 2025-02-15 13:32:35

由于它们是两个完全不同的类别,因此不能太容易地总结一下:

通过快速查看其属性,您可以获得一些想法。

httpresponse

“


https://学习。 microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-6.0

“

That can't be too easily summarized since they are two completely different classes:

You can get a bit of an idea by a quick look at their properties.

HttpResponse

https://learn.microsoft.com/en-us/dotnet/api/system.web.httpresponse?view=netframework-4.8

response properties

HttpResponseMessage
https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-6.0

http response message properties

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文