-1

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?

1 Answers1

-2

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

raddevus
  • 8,142
  • 7
  • 66
  • 87