fn encode_response<T: Serialize>(
headers: &HeaderMap,
value: T,
) -> Result<Response, ApiError>Expand description
Encode a successful response body based on the request’s Accept header, matching
tide-disco’s content negotiation.
surf-disco’s default Accept is application/octet-stream, so production internal clients
(peer-catchup, submit-transactions, light-client provider) expect VBS-encoded responses for
the endpoints that flow large structured data. Falls back to JSON otherwise.