C# Class org.GraphDefined.Vanaheimr.Hermod.HTTP.HTTPResponseBuilder

A read-write HTTP response header.
Inheritance: AHTTPPDUBuilder
Afficher le fichier Open project: Vanaheimr/Hermod Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
PrepareImmutability ( ) : void

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

Method Details

AsImmutable() public méthode

Converts this HTTPResponseBuilder into an immutable HTTPResponse.
public AsImmutable ( ) : HTTPResponse
Résultat HTTPResponse

HTTPResponseBuilder() public méthode

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
Résultat System

OK() public static méthode

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.
Résultat HTTPResponseBuilder

OK() public static méthode

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.
Résultat HTTPResponseBuilder

PrepareImmutability() protected méthode

Prepares the immutability of an HTTP PDU, e.g. calculates and set the Content-Length header.
protected PrepareImmutability ( ) : void
Résultat void

Set() public méthode

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.
Résultat HTTPResponseBuilder

SetCacheControl() public méthode

Set the HTTP CacheControl.
public SetCacheControl ( String CacheControl ) : HTTPResponseBuilder
CacheControl String CacheControl.
Résultat HTTPResponseBuilder

SetConnection() public méthode

Set the HTTP connection.
public SetConnection ( String Connection ) : HTTPResponseBuilder
Connection String A connection.
Résultat HTTPResponseBuilder

SetContent() public méthode

The HTTP content/body.
public SetContent ( Byte ByteArray ) : HTTPResponseBuilder
ByteArray Byte The HTTP content/body.
Résultat HTTPResponseBuilder

SetContent() public méthode

The HTTP content/body as a stream.
public SetContent ( Stream ContentStream ) : HTTPResponseBuilder
ContentStream Stream
Résultat HTTPResponseBuilder

SetContent() public méthode

The HTTP content/body.
public SetContent ( String String ) : HTTPResponseBuilder
String String The HTTP content/body.
Résultat HTTPResponseBuilder

SetContentEncoding() public méthode

Set the HTTP Content-Encoding.
public SetContentEncoding ( Encoding ContentEncoding ) : HTTPResponseBuilder
ContentEncoding System.Text.Encoding The encoding of the HTTP content/body.
Résultat HTTPResponseBuilder

SetContentLanguage() public méthode

Set the HTTP Content-Languages.
public SetContentLanguage ( List ContentLanguages ) : HTTPResponseBuilder
ContentLanguages List The languages of the HTTP content/body.
Résultat HTTPResponseBuilder

SetContentLength() public méthode

Set the HTTP Content-Length.
public SetContentLength ( System.UInt64 ContentLength ) : HTTPResponseBuilder
ContentLength System.UInt64 The length of the HTTP content/body.
Résultat HTTPResponseBuilder

SetContentLocation() public méthode

Set the HTTP ContentLocation.
public SetContentLocation ( String ContentLocation ) : HTTPResponseBuilder
ContentLocation String ContentLocation.
Résultat HTTPResponseBuilder

SetContentMD5() public méthode

Set the HTTP ContentMD5.
public SetContentMD5 ( String ContentMD5 ) : HTTPResponseBuilder
ContentMD5 String ContentMD5.
Résultat HTTPResponseBuilder

SetContentRange() public méthode

Set the HTTP ContentRange.
public SetContentRange ( String ContentRange ) : HTTPResponseBuilder
ContentRange String ContentRange.
Résultat HTTPResponseBuilder

SetContentType() public méthode

Set the HTTP Content-Type.
public SetContentType ( HTTPContentType ContentType ) : HTTPResponseBuilder
ContentType HTTPContentType The type of the HTTP content/body.
Résultat HTTPResponseBuilder

SetDate() public méthode

Set the HTTP Date.
public SetDate ( System.DateTime Date ) : HTTPResponseBuilder
Date System.DateTime DateTime.
Résultat HTTPResponseBuilder

SetHTTPStatusCode() public méthode

Set the HTTP status code.
public SetHTTPStatusCode ( HTTPStatusCode HTTPStatusCode ) : HTTPResponseBuilder
HTTPStatusCode HTTPStatusCode A HTTP status code.
Résultat HTTPResponseBuilder

SetProtocolName() public méthode

Set the protocol name.
public SetProtocolName ( String ProtocolName ) : HTTPResponseBuilder
ProtocolName String The protocol name.
Résultat HTTPResponseBuilder

SetProtocolVersion() public méthode

Set the protocol version.
public SetProtocolVersion ( HTTPVersion ProtocolVersion ) : HTTPResponseBuilder
ProtocolVersion HTTPVersion The protocol version.
Résultat HTTPResponseBuilder

SetVia() public méthode

Set the HTTP Via.
public SetVia ( String Via ) : HTTPResponseBuilder
Via String Via.
Résultat HTTPResponseBuilder