rdap 0.2.0

A modern RDAP (Registration Data Access Protocol) client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Example: JSON output

use rdap::{QueryType, RdapClient, RdapRequest};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = RdapClient::new()?;
    let request = RdapRequest::new(QueryType::Domain, "example.com");

    let result = client.query(&request).await?;

    // Output as pretty JSON
    let json = serde_json::to_string_pretty(&result)?;
    println!("{}", json);

    Ok(())
}