HttpResponse is defined in the Telligent.Evolution.Extensibility.Version1 namespace.
Definition
class HttpResponse
{
Stream Body { get; }
string ContentType { get; set; }
CookieCollection Cookies { get; }
bool HasStarted { get; }
HeaderCollection Headers { get; }
bool IsComplete { get; set; }
int StatusCode { get; set; }
void Clear();
void Complete();
Task CompleteAsync();
void Redirect(string url, int statusCode = 302);
Task WriteAsync(string content, CancellationToken token = null);
}
Properties
| Name | Type | Description | Default | Options |
|---|---|---|---|---|
| Body | Stream | |||
| ContentType | string | |||
| Cookies | CookieCollection | |||
| HasStarted | bool | |||
| Headers | HeaderCollection | |||
| IsComplete | bool | |||
| StatusCode | int |
Methods
void Clear();
void Complete();
Task CompleteAsync();
Return Type
void Redirect(string url, int statusCode = 302);
Redirects to the requested URL. This method throws an exception that will end the current request.
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| url | string | Url | Required | ||
| statusCode | int | Status Code | Optional | 302 |
Task WriteAsync(string content, CancellationToken token = null);
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| content | string | Content | Required | ||
| token | CancellationToken | Token | Optional |