Skip to main content

upload_blob_from_url

Function upload_blob_from_url 

Source
pub async fn upload_blob_from_url(
    http: &Client,
    pds_endpoint: &str,
    access_token: &str,
    image_url: &str,
) -> Result<BlobRef, RepoError>
Expand description

Fetch an image from a URL and upload it as a blob to the user’s PDS.

Downloads the resource at image_url, determines its MIME type from the Content-Type response header (defaulting to application/octet-stream), and uploads it via upload_blob.