Skip to content

Class BSV::Network::ProtocolResponse

Inherits: Object

Attributes

data [R]

Returns the value of attribute data.

error_message [R]

Returns the value of attribute error_message.

Public Instance Methods

body()

Delegated from Net::HTTPResponse (nil-safe)

canonical()

Canonical form (placeholder — delegates to data until shapes are defined)

code()

Not documented.

content_type()

Not documented.

http_not_found?()

  • @return [Boolean]

http_success?()

Two layers of status predicates:

HTTP logical status — did the operation succeed? Driven by the http_success: parameter, which defaults to the RFC 9110 success class check (Net::HTTPSuccess, i.e. 2xx) but can be overridden by escape hatches that reinterpret HTTP status (e.g. ARC REJECTED on 2xx sets http_success: false; WoC is_utxo 404 sets http_success: true).

Transport status — what did the HTTP layer actually return? These always reflect the Net::HTTPResponse class hierarchy regardless of the http_success: override. http_not_found? maps directly to Net::HTTPNotFound (404). retryable? is a domain composite: 429 (Net::HTTPTooManyRequests) or 5xx (Net::HTTPServerError) — not an RFC 9110 category itself, but a useful signal for retry logic. - @return [Boolean]

initialize(http_response, data: = nil, http_success: = nil, error_message: = nil)

  • @return [ProtocolResponse] a new instance of ProtocolResponse

retryable?()

  • @return [Boolean]

with(**overrides)

Derive new response with overrides (same HTTP response, different interpretation)