基于 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(())
}