pub fn serialize_request_to_json<T: Serialize>(request: &T) -> Result<String>
Helper function to serialize a request to JSON
Returns an error if the request cannot be serialized to JSON format.