odata-simple-client
This crate provides a Rust-interface to an OData 3.0 API over HTTP(S)
To get started, construct a DataSource
and then create either a ListRequest
or GetRequest
and fetch
/fetch_paged
it using your DataSource
Here's a complete example which fetches a single Dokument
from the Danish Parliament's OData API:
use ;
use ;
use ;
use Deserialize;
// Construct a Hyper client for communicating over HTTPS
let client: =
builder.build;
// Set up our DataSource. The API is reachable on https://oda.ft.dk/api/
let datasource = new.unwrap;
// The tokio_test::block_on call is just to make this example work in a rustdoc example.
// Normally you would just write the enclosed code in an async function.
block_on;
The example above has requirements on a number of crates. See the Cargo.toml
-file for a list.