Crate lemmy_client
source ·Expand description
A Rust HTTP client for Lemmy. If used when targeting WASM, uses the browser’s built-in fetch API to reduce bundle size.
§Example
use lemmy_client::{LemmyClient, ClientOptions};
async fn get_site_test() {
let client = LemmyClient::new(ClientOptions {
domain: String::from("lemmy.ml"),
secure: true
});
let res = client.get_site(()).await;
assert!(res.is_ok());
}Re-exports§
pub use lemmy_api_common;
Structs§
- Options for instantiating a
LemmyClient. - API wrapper for lemmy
- A request to send to lemmy. If you don’t want to set the JWT for each request, you can set the Authorization header with
LemmyClient::headers_mut.