Class HttpBuilder

Namespace: redb.Route.Http
Assembly: redb.Route.Http.dll

Fluent builder for HTTP/HTTPS endpoint URIs.

public sealed class HttpBuilder

Inheritance

Object→HttpBuilder

Methods

AuthToken(IExpression)

Bearer/API-key token value or expression (e.g. Property("jwt")).

public HttpBuilder AuthToken(IExpression token)

AuthToken(string)

Bearer/API-key token value (template string, supports ${...}).

public HttpBuilder AuthToken(string token)

BasicAuth(IExpression, IExpression)

Use HTTP Basic authentication.

public HttpBuilder BasicAuth(IExpression username, IExpression password)

BasicAuth(string, string)

Use HTTP Basic authentication (template strings, support ${...}).

public HttpBuilder BasicAuth(string username, string password)

BearerAuth()

Use Bearer token authentication. Token is resolved via AuthToken option at runtime.

public HttpBuilder BearerAuth()

Build()

Builds the HTTP/HTTPS endpoint URI string.

public string Build()

ConnectionFactory(string)

References a named from the route registry instead of

public HttpBuilder ConnectionFactory(string name)

ContentType(string)

Content type. Default "application/json".

public HttpBuilder ContentType(string contentType)

Cors(string?)

Enable CORS with optional allowed origins.

public HttpBuilder Cors(string? origins = null)

CorsCredentials()

Allow credentials in CORS requests.

public HttpBuilder CorsCredentials()

HeaderFilterStrategy(string)

The header filter strategy of the endpoint, by registry name (headerFilterStrategy=#name): an

public HttpBuilder HeaderFilterStrategy(string registryName)

Host(IExpression)

Target host. Producer: part of request URL. Consumer: Kestrel bind address.

public HttpBuilder Host(IExpression host)

Host(string)

Target host (template string, supports ${...}). Producer: part of request URL. Consumer: Kestrel bind address.

public HttpBuilder Host(string host)

InOut()

Enable request-reply (InOut) exchange pattern.

public HttpBuilder InOut()

MaxConcurrentRequests(int, int)

Admission limit: at most max concurrent pipeline executions; overflow

public HttpBuilder MaxConcurrentRequests(int max, int queue = 0)

MaxRedirects(IExpression)

Maximum number of redirects from an expression.

public HttpBuilder MaxRedirects(IExpression max)

MaxRedirects(int)

Maximum number of redirects to follow. Default 50.

public HttpBuilder MaxRedirects(int max)

MaxRequestBodySize(IExpression)

Maximum request body size from an expression.

public HttpBuilder MaxRequestBodySize(IExpression bytes)

MaxRequestBodySize(long)

Maximum request body size in bytes. Default 10 MB.

public HttpBuilder MaxRequestBodySize(long bytes)

Methods(string)

Comma-separated HTTP methods to accept (e.g. "POST,PUT"). Default: all.

public HttpBuilder Methods(string methods)

NoFollowRedirects()

Disable following HTTP redirects. Default is to follow.

public HttpBuilder NoFollowRedirects()

NoThrowOnError()

Disable throwing on non-success HTTP status codes. Default is to throw.

public HttpBuilder NoThrowOnError()

Param(string, IExpression)

Adds a query-string parameter bound to an expression, resolved at runtime.

public HttpBuilder Param(string name, IExpression expression)

Param(string, object?)

Adds a query-string parameter to the HTTP request URL.

public HttpBuilder Param(string name, object? value)

Port(IExpression)

Target port from an expression — resolved per message at runtime.

public HttpBuilder Port(IExpression port)

Port(int)

Target port. Producer: part of request URL. Consumer: Kestrel bind port.

public HttpBuilder Port(int port)

PreserveHostHeader()

Preserve the original Host header when proxying.

public HttpBuilder PreserveHostHeader()

Protocol(string)

HTTP protocol version: Http1, Http2, Http1And2, Http3, Http1And2And3.

public HttpBuilder Protocol(string protocol)

RejectStatusCode(int)

Status code for a shed request (default 429).

public HttpBuilder RejectStatusCode(int statusCode)

ResponseCode(IExpression)

Response status code from an expression.

public HttpBuilder ResponseCode(IExpression code)

ResponseCode(int)

Default HTTP response status code. Default 200.

public HttpBuilder ResponseCode(int code)

RetryAfterSeconds(int)

Retry-After value for a shed request in seconds; 0 = do not send (default 1).

public HttpBuilder RetryAfterSeconds(int seconds)

SkipControlHeaders()

Do not let redbHttp.Method / redbHttp.Query on the exchange steer the request

public HttpBuilder SkipControlHeaders()

SkipRequestHeaders()

Do not map exchange headers to request headers (skipRequestHeaders=true).

public HttpBuilder SkipRequestHeaders()

SkipResponseHeaders()

Do not map response headers to exchange headers (skipResponseHeaders=true).

public HttpBuilder SkipResponseHeaders()

SslCert(IExpression, IExpression?)

Enable SSL/TLS with the given certificate.

public HttpBuilder SslCert(IExpression certPath, IExpression? certPassword = null)

SslCert(string, string?)

Enable SSL/TLS with the given certificate (template strings, support ${...}).

public HttpBuilder SslCert(string certPath, string? certPassword = null)

StreamRequest()

Enable request body streaming (consumer: body = Stream instead of byte[]).

public HttpBuilder StreamRequest()

StreamResponse()

Enable response body streaming (producer: Out body = Stream instead of byte[]).

public HttpBuilder StreamResponse()

Timeout(IExpression)

Request/response timeout from an expression.

public HttpBuilder Timeout(IExpression timeout)

Timeout(int)

Request/response timeout in milliseconds. Default 30000.

public HttpBuilder Timeout(int ms)

ToString()

Returns a string that represents the current object.

public override string ToString()