C# Класс org.GraphDefined.Vanaheimr.Hermod.HTTP.HTTPResponseBuilder

A read-write HTTP response header.
Наследование: AHTTPPDUBuilder
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AsImmutable ( ) : HTTPResponse

Converts this HTTPResponseBuilder into an immutable HTTPResponse.

HTTPResponseBuilder ( HTTPRequest HTTPRequest, HTTPStatusCode HTTPStatusCode = null ) : System

Create a new HTTP response.

OK ( HTTPRequest HTTPRequest, Action Configurator = null ) : HTTPResponseBuilder

Create a new 200-OK HTTP response and apply the given delegate.

OK ( HTTPRequest HTTPRequest, HTTPResponseBuilder>.Func Configurator ) : HTTPResponseBuilder

Create a new 200-OK HTTP response and apply the given delegate.

Set ( HTTPHeaderField HeaderField, Object Value ) : HTTPResponseBuilder

Set a HTTP header field. A field value of NULL will remove the field from the header.

SetCacheControl ( String CacheControl ) : HTTPResponseBuilder

Set the HTTP CacheControl.

SetConnection ( String Connection ) : HTTPResponseBuilder

Set the HTTP connection.

SetContent ( Byte ByteArray ) : HTTPResponseBuilder

The HTTP content/body.

SetContent ( Stream ContentStream ) : HTTPResponseBuilder

The HTTP content/body as a stream.

SetContent ( String String ) : HTTPResponseBuilder

The HTTP content/body.

SetContentEncoding ( Encoding ContentEncoding ) : HTTPResponseBuilder

Set the HTTP Content-Encoding.

SetContentLanguage ( List ContentLanguages ) : HTTPResponseBuilder

Set the HTTP Content-Languages.

SetContentLength ( System.UInt64 ContentLength ) : HTTPResponseBuilder

Set the HTTP Content-Length.

SetContentLocation ( String ContentLocation ) : HTTPResponseBuilder

Set the HTTP ContentLocation.

SetContentMD5 ( String ContentMD5 ) : HTTPResponseBuilder

Set the HTTP ContentMD5.

SetContentRange ( String ContentRange ) : HTTPResponseBuilder

Set the HTTP ContentRange.

SetContentType ( HTTPContentType ContentType ) : HTTPResponseBuilder

Set the HTTP Content-Type.

SetDate ( System.DateTime Date ) : HTTPResponseBuilder

Set the HTTP Date.

SetHTTPStatusCode ( HTTPStatusCode HTTPStatusCode ) : HTTPResponseBuilder

Set the HTTP status code.

SetProtocolName ( String ProtocolName ) : HTTPResponseBuilder

Set the protocol name.

SetProtocolVersion ( HTTPVersion ProtocolVersion ) : HTTPResponseBuilder

Set the protocol version.

SetVia ( String Via ) : HTTPResponseBuilder

Set the HTTP Via.

Защищенные методы

Метод Описание
PrepareImmutability ( ) : void

Prepares the immutability of an HTTP PDU, e.g. calculates and set the Content-Length header.

Описание методов

AsImmutable() публичный Метод

Converts this HTTPResponseBuilder into an immutable HTTPResponse.
public AsImmutable ( ) : HTTPResponse
Результат HTTPResponse

HTTPResponseBuilder() публичный Метод

Create a new HTTP response.
public HTTPResponseBuilder ( HTTPRequest HTTPRequest, HTTPStatusCode HTTPStatusCode = null ) : System
HTTPRequest HTTPRequest The HTTP request for this response.
HTTPStatusCode HTTPStatusCode A HTTP status code
Результат System

OK() публичный статический Метод

Create a new 200-OK HTTP response and apply the given delegate.
public static OK ( HTTPRequest HTTPRequest, Action Configurator = null ) : HTTPResponseBuilder
HTTPRequest HTTPRequest
Configurator Action A delegate to configure the HTTP response.
Результат HTTPResponseBuilder

OK() публичный статический Метод

Create a new 200-OK HTTP response and apply the given delegate.
public static OK ( HTTPRequest HTTPRequest, HTTPResponseBuilder>.Func Configurator ) : HTTPResponseBuilder
HTTPRequest HTTPRequest
Configurator HTTPResponseBuilder>.Func A delegate to configure the HTTP response.
Результат HTTPResponseBuilder

PrepareImmutability() защищенный Метод

Prepares the immutability of an HTTP PDU, e.g. calculates and set the Content-Length header.
protected PrepareImmutability ( ) : void
Результат void

Set() публичный Метод

Set a HTTP header field. A field value of NULL will remove the field from the header.
public Set ( HTTPHeaderField HeaderField, Object Value ) : HTTPResponseBuilder
HeaderField HTTPHeaderField The header field.
Value Object The value. NULL will remove the field from the header.
Результат HTTPResponseBuilder

SetCacheControl() публичный Метод

Set the HTTP CacheControl.
public SetCacheControl ( String CacheControl ) : HTTPResponseBuilder
CacheControl String CacheControl.
Результат HTTPResponseBuilder

SetConnection() публичный Метод

Set the HTTP connection.
public SetConnection ( String Connection ) : HTTPResponseBuilder
Connection String A connection.
Результат HTTPResponseBuilder

SetContent() публичный Метод

The HTTP content/body.
public SetContent ( Byte ByteArray ) : HTTPResponseBuilder
ByteArray Byte The HTTP content/body.
Результат HTTPResponseBuilder

SetContent() публичный Метод

The HTTP content/body as a stream.
public SetContent ( Stream ContentStream ) : HTTPResponseBuilder
ContentStream Stream
Результат HTTPResponseBuilder

SetContent() публичный Метод

The HTTP content/body.
public SetContent ( String String ) : HTTPResponseBuilder
String String The HTTP content/body.
Результат HTTPResponseBuilder

SetContentEncoding() публичный Метод

Set the HTTP Content-Encoding.
public SetContentEncoding ( Encoding ContentEncoding ) : HTTPResponseBuilder
ContentEncoding System.Text.Encoding The encoding of the HTTP content/body.
Результат HTTPResponseBuilder

SetContentLanguage() публичный Метод

Set the HTTP Content-Languages.
public SetContentLanguage ( List ContentLanguages ) : HTTPResponseBuilder
ContentLanguages List The languages of the HTTP content/body.
Результат HTTPResponseBuilder

SetContentLength() публичный Метод

Set the HTTP Content-Length.
public SetContentLength ( System.UInt64 ContentLength ) : HTTPResponseBuilder
ContentLength System.UInt64 The length of the HTTP content/body.
Результат HTTPResponseBuilder

SetContentLocation() публичный Метод

Set the HTTP ContentLocation.
public SetContentLocation ( String ContentLocation ) : HTTPResponseBuilder
ContentLocation String ContentLocation.
Результат HTTPResponseBuilder

SetContentMD5() публичный Метод

Set the HTTP ContentMD5.
public SetContentMD5 ( String ContentMD5 ) : HTTPResponseBuilder
ContentMD5 String ContentMD5.
Результат HTTPResponseBuilder

SetContentRange() публичный Метод

Set the HTTP ContentRange.
public SetContentRange ( String ContentRange ) : HTTPResponseBuilder
ContentRange String ContentRange.
Результат HTTPResponseBuilder

SetContentType() публичный Метод

Set the HTTP Content-Type.
public SetContentType ( HTTPContentType ContentType ) : HTTPResponseBuilder
ContentType HTTPContentType The type of the HTTP content/body.
Результат HTTPResponseBuilder

SetDate() публичный Метод

Set the HTTP Date.
public SetDate ( System.DateTime Date ) : HTTPResponseBuilder
Date System.DateTime DateTime.
Результат HTTPResponseBuilder

SetHTTPStatusCode() публичный Метод

Set the HTTP status code.
public SetHTTPStatusCode ( HTTPStatusCode HTTPStatusCode ) : HTTPResponseBuilder
HTTPStatusCode HTTPStatusCode A HTTP status code.
Результат HTTPResponseBuilder

SetProtocolName() публичный Метод

Set the protocol name.
public SetProtocolName ( String ProtocolName ) : HTTPResponseBuilder
ProtocolName String The protocol name.
Результат HTTPResponseBuilder

SetProtocolVersion() публичный Метод

Set the protocol version.
public SetProtocolVersion ( HTTPVersion ProtocolVersion ) : HTTPResponseBuilder
ProtocolVersion HTTPVersion The protocol version.
Результат HTTPResponseBuilder

SetVia() публичный Метод

Set the HTTP Via.
public SetVia ( String Via ) : HTTPResponseBuilder
Via String Via.
Результат HTTPResponseBuilder