基於 Rust 構建

Rust 驅動的高效能隨機圖片 API

基於 Rust 構建的輕量、高效能圖片服務接口。透過簡單 API 快速獲取隨機圖片,適用於網站背景、應用開發和測試場景。

Random image
GEThttps://api.rpicx.com/v1/random
curl 'https://api.rpicx.com/v1/random'
<img src="https://api.rpicx.com/v1/random" />
fetch('https://api.rpicx.com/v1/random')
  .then(res => res.blob())
  .then(blob => {
    const img = document.createElement('img')
    img.src = URL.createObjectURL(blob)
    document.body.appendChild(img)
  })
use reqwest;

#[tokio::main]
async fn main() -> Result<()> {
    let resp = reqwest::get("https://api.rpicx.com/v1/random")
        .await?;
    let bytes = resp.bytes().await?;
    println!("Downloaded " + &bytes.len().to_string() + " bytes");
    Ok(())
}