Class HttpResponse
Ответ.
Inheritance
System.Object
HttpResponse
Namespace:InfinniPlatform.Http
Assembly:InfinniPlatform.Core.Abstractions.dll
Syntax
public class HttpResponse : object, IHttpResponse
Constructors
| Improve this Doc View SourceHttpResponse(Int32, String)
Конструктор.
Declaration
public HttpResponse(int statusCode = 200, string contentType = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | statusCode | Код состояния. |
System.String | contentType | Тип содержимого тела ответа. |
Fields
| Improve this Doc View SourceForbidden
Запрос запрещен.
Declaration
public static readonly IHttpResponse Forbidden
Field Value
Type | Description |
---|---|
IHttpResponse |
NoContent
Ответ не имеет содержимого.
Declaration
public static readonly Action<Stream> NoContent
Field Value
Type | Description |
---|---|
Action<Stream> |
NotFound
Ресурс не найден.
Declaration
public static readonly IHttpResponse NotFound
Field Value
Type | Description |
---|---|
IHttpResponse |
Ok
Запрос успешен.
Declaration
public static readonly IHttpResponse Ok
Field Value
Type | Description |
---|---|
IHttpResponse |
Unauthorized
Запрос не авторизован.
Declaration
public static readonly IHttpResponse Unauthorized
Field Value
Type | Description |
---|---|
IHttpResponse |
Properties
| Improve this Doc View SourceContent
Метод записи содержимого тела ответа.
Declaration
public Action<Stream> Content { get; set; }
Property Value
Type | Description |
---|---|
Action<Stream> |
Implements
| Improve this Doc View SourceContentType
Тип содержимого тела ответа.
Declaration
public string ContentType { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
| Improve this Doc View SourceHeaders
Заголовок ответа.
Declaration
public IDictionary<string, string> Headers { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<System.String, System.String> |
Implements
| Improve this Doc View SourceReasonPhrase
Описание состояния.
Declaration
public string ReasonPhrase { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
| Improve this Doc View SourceStatusCode
Код состояния.
Declaration
public int StatusCode { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Implements
Methods
| Improve this Doc View SourceGetHeader(String)
Возвращает значение заголовка.
Declaration
public string GetHeader(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Returns
Type | Description |
---|---|
System.String |
SetHeader(String, String)
Устанавливает значение заголовка.
Declaration
public void SetHeader(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | |
System.String | value |