Class
HttpResponse
Represents an HTTP Response.
public class HttpResponseInheritance #
Inherited Members #
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Extension Methods #
HttpResponseExtensions.WithContent<HttpResponse>(HttpResponse, string), HttpResponseExtensions.WithContent<HttpResponse>(HttpResponse, string, Encoding?, string), HttpResponseExtensions.WithContent<HttpResponse>(HttpResponse, HttpContent), HttpResponseExtensions.WithCookie<HttpResponse>(HttpResponse, string, string, DateTime?, TimeSpan?, string?, string?, bool?, bool?, string?), HttpResponseExtensions.WithCookie<HttpResponse>(HttpResponse, Cookie), HttpResponseExtensions.WithHeader<HttpResponse>(HttpResponse, string, string), HttpResponseExtensions.WithHeaders<HttpResponse>(HttpResponse, IDictionary<string, string?>), HttpResponseExtensions.WithHeaders<HttpResponse>(HttpResponse, StringKeyStoreCollection), HttpResponseExtensions.WithStatus<HttpResponse>(HttpResponse, int), HttpResponseExtensions.WithStatus<HttpResponse>(HttpResponse, HttpStatusCode), HttpResponseExtensions.WithStatus<HttpResponse>(HttpResponse, in HttpStatusInformation)
Constructors #
| Name | Description |
|---|---|
| HttpResponse() | Creates an new HttpResponse instance with HTTP OK status code and no content. |
| 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(string) | Creates an new HttpResponse instanec with given string content and status code as 200 OK. |
| HttpResponse(HttpStatusCode, string) | Creates an new HttpResponse instance with given status code and string content. |
| HttpResponse(HttpStatusCode, HttpContent?) | Creates an new HttpResponse instance with given status code and HTTP contents. |
| HttpResponse(in HttpStatusInformation) | Creates an new HttpResponse instance with given status code. |
Properties #
| Name | Description |
|---|---|
| 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 #
| Name | Description |
|---|---|
| Equals(object?) | |
| GetHashCode() | |
| GetHeaderValue(string) | Gets the value of a specific header from the request and content headers. |
| 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. |
| ToString() |