4 releases
0.2.2 | May 7, 2024 |
---|---|
0.2.1 | May 5, 2024 |
0.2.0 | May 3, 2024 |
0.1.0 | May 2, 2024 |
#510 in Web programming
455 downloads per month
38KB
698 lines
About
This library provides an interface (or whatever you want to call it) for working with the Nadeo API. It handles authentication automatically but API requests have to be build up manually by the user.
⚠️ This project is in early development ⚠️
Installation
Run
cargo add nadeo-api
or add this line to your Cargo.toml
with the desired version:
nadeo-api = "0.2.2"
Getting started
Creating a client:
use nadeo_api::NadeoClient;
let mut client = NadeoClient::builder()
.with_normal_auth("my_email", "my_password")
.with_oauth("my_identifier", "my_secret")
.user_agent("My cool Application / my.email@domain.com")
.build()
.await?;
Creating a request:
use nadeo_api::NadeoRequest;
use nadeo_api::auth::AuthType;
use nadeo_api::request::HttpMethod;
let request = NadeoRequest::builder()
.url("api_endpoint_url")
.auth_type(AuthType::NadeoServices)
.method(HttpMethod::Get)
.build()?;
Executing a request:
let mut client = /* snap */;
let request = /* snap */;
let response = client.execute(request).await?;
License
This project is licensed under Apache License, Version 2.0.
Dependencies
~7–22MB
~292K SLoC