Class RequestResponseBase
Abstract base class for similar objects shared by both request and response objects.
Inherited Members
Namespace: Titanium.Web.Proxy.Http
Assembly: Titanium.Web.Proxy.dll
Syntax
public abstract class RequestResponseBase
Properties
| Edit this page View SourceBody
Body as byte array
Declaration
[Browsable(false)]
public byte[] Body { get; }
Property Value
| Type | Description |
|---|---|
| byte[] |
BodyInternal
Cached body content as byte array.
Declaration
protected byte[]? BodyInternal { get; }
Property Value
| Type | Description |
|---|---|
| byte[] |
BodyString
Body as string. Use the encoding specified to decode the byte[] data to string
Declaration
[Browsable(false)]
public string BodyString { get; }
Property Value
| Type | Description |
|---|---|
| string |
ContentEncoding
Content encoding for this request/response.
Declaration
public string? ContentEncoding { get; }
Property Value
| Type | Description |
|---|---|
| string |
ContentLength
Length of the body.
Declaration
public long ContentLength { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
ContentType
Content-type of the request/response.
Declaration
public string? ContentType { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Encoding
Encoding for this request/response.
Declaration
public Encoding Encoding { get; }
Property Value
| Type | Description |
|---|---|
| Encoding |
HasBody
Has the request/response body?
Declaration
public abstract bool HasBody { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HeaderText
The header text.
Declaration
public abstract string HeaderText { get; }
Property Value
| Type | Description |
|---|---|
| string |
Headers
Collection of all headers.
Declaration
public HeaderCollection Headers { get; }
Property Value
| Type | Description |
|---|---|
| HeaderCollection |
HttpVersion
Http Version.
Declaration
public Version HttpVersion { get; set; }
Property Value
| Type | Description |
|---|---|
| Version |
IsBodyRead
Was the body read by user?
Declaration
public bool IsBodyRead { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsChunked
Is body send as chunked bytes.
Declaration
public bool IsChunked { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
KeepBody
Keeps the body data after the session is finished.
Declaration
public bool KeepBody { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
TrailingHeaders
Trailing headers ("trailers") carried after the body, per RFC 9110 §6.5 / RFC 7230 §4.1.2
(HTTP/1.1 chunked) and as a second HEADERS block after DATA on HTTP/2/HTTP/3.
Empty by default (lazily allocated on first access). Trailers are not defined for, and are
always ignored on, fixed Content-Length bodies.
On the read side, this is populated once the body has actually been consumed (streamed,
buffered, or drained) - it is not guaranteed to be populated yet during
BeforeRequest/BeforeResponse. It is reliably observable in AfterResponse
for streaming pass-through, or earlier only when the body was explicitly buffered
(e.g. via GetResponseBody/GetRequestBody).
On the write side, entries added here before the body finishes writing are emitted as the
HTTP/1.1 trailer block after the terminating zero-length chunk, or as trailer HEADERS on
HTTP/2/HTTP/3. A small set of framing/routing header fields (e.g. Transfer-Encoding,
Content-Length, Trailer, Host) are forbidden in a trailer and will fail
with a clear exception rather than being silently dropped.
Declaration
public HeaderCollection TrailingHeaders { get; }
Property Value
| Type | Description |
|---|---|
| HeaderCollection |
Methods
| Edit this page View SourceToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |