tangled-api 0.1.0

Lexicon-generated XRPC client for Tangled and AT Protocol APIs
Documentation
// @generated by `cargo xtask codegen` — do not edit.
// source: lexicons/com/atproto/repo/uploadBlob.json (com.atproto.repo.uploadBlob)

#![allow(clippy::all)]

pub const NSID: &str = "com.atproto.repo.uploadBlob";

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Output {
    pub blob: crate::types::BlobRef,
}

/// Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS.
pub fn upload_blob(
    http: &reqwest::Client,
    base: &str,
    body: reqwest::Body,
    content_type: &str,
) -> reqwest::RequestBuilder {
    let rb = http.post(crate::xrpc::xrpc_url(base, NSID));
    let rb = rb.header(reqwest::header::ACCEPT, "application/json");
    let rb = rb
        .header(reqwest::header::CONTENT_TYPE, content_type)
        .body(body);
    rb
}