diff --git a/progenitor-client/src/progenitor_client.rs b/progenitor-client/src/progenitor_client.rs index 373ad63..6bf1f29 100644 --- a/progenitor-client/src/progenitor_client.rs +++ b/progenitor-client/src/progenitor_client.rs @@ -127,6 +127,16 @@ impl ResponseValue { &self.headers } + /// Get the parsed value of the Content-Length header, if present and valid. + pub fn content_length(&self) -> Option { + self.headers + .get(reqwest::header::CONTENT_LENGTH)? + .to_str() + .ok()? + .parse::() + .ok() + } + #[doc(hidden)] pub fn map( self,