crops_api_client

Crates.iocrops_api_client
lib.rscrops_api_client
version0.1.0
sourcesrc
created_at2024-10-29 15:00:20.97247
updated_at2024-10-29 15:00:20.97247
descriptionUnofficial reqwest-blocking based HTTP client to consume Harvest API
homepagehttps://github.com/rmoraes92/crops/tree/main/crops_api_client
repository
max_upload_size
id1427112
size8,462
Ramon Moraes (rmoraes92)

documentation

https://docs.rs/crops_api_client/latest/crops_api_client/

README

Crops API Client

Unofficial reqwest-blocking based HTTP client to consume Harvest API

Install

$ cargo add crops_api_client

Usage

use crops_api_client:Client;:
use crops_api_models::UserMe;

fn main() {
    let auth_token = "...";
    let acc_id = "...";

    let model: UserMe = Client::new(acc_id, auth_token).request::<UserMe>(
        "GET",
        "/users/me",
        None,
        None,
    ).unwrap();
    dbg!(model);
}

License

The MIT License (MIT)

Copyright © 2023 Ramon Moraes

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Commit count: 0

cargo fmt