Class HttpResponse
Represents an HTTP Response.
public class HttpResponse
- Inheritance
-
HttpResponse
- Inherited Members
- Extension Methods
Constructors
- HttpResponse()
Creates an new HttpResponse instance with HTTP OK status code and no content.
- HttpResponse(in HttpStatusInformation)
Creates an new HttpResponse instance with given status code.
- HttpResponse(int)
Creates an new HttpResponse instance with given status code.
- HttpResponse(int, HttpContent?)
Creates an new HttpResponse instance with given status code and HTTP content.
- HttpResponse(HttpContent?)
Creates an new HttpResponse instance with given HTTP content, with default status code as 200 OK.
- HttpResponse(HttpStatusCode)
Creates an new HttpResponse instance with given status code.
- HttpResponse(HttpStatusCode, HttpContent?)
Creates an new HttpResponse instance with given status code and HTTP contents.
- HttpResponse(string)
Creates an new HttpResponse instanec with given string content and status code as 200 OK.
Properties
- Content
Gets or sets the HTTP response body contents.
- Headers
Gets or sets the HttpHeaderCollection instance of the HTTP response headers.
- SendChunked
Gets or sets whether the HTTP response will be sent chunked. When setting this property to
true
, the Content-Length header is automatically omitted.
- Status
Gets or sets the HTTP status code and description for this HTTP response.
Methods
- GetRawHttpResponse(bool)
Gets a visual representation of this HTTP response.
- Refuse()
Creates an HttpResponse object which closes the connection with the client immediately (ECONNRESET).
- SetCookie(Cookie)
Sets a cookie and sends it in the response to be set by the client.
- SetCookie(string, string)
Sets a cookie and sends it in the response to be set by the client.
- SetCookie(string, string, DateTime?, TimeSpan?, string?, string?, bool?, bool?, string?)
Sets a cookie and sends it in the response to be set by the client.