Skip to main content

decode_body

Function decode_body 

Source
fn decode_body<T: DeserializeOwned>(
    headers: &HeaderMap,
    body: &[u8],
) -> Result<T, ApiError>
Expand description

Decode a request body based on its Content-Type, matching tide-disco’s body_auto behavior.

  • application/octet-stream: VBS (versioned binary) — what surf-disco::Request::body_binary sends, and what production peer-catchup / submit-transactions clients use.
  • application/json: serde_json.

All v1 endpoints in this codebase use the V0_1 API version for VBS framing.