Wiki: Rust Reqwest Crate: Default User Agent/project-management-only / Scraper Snitch Bot



The reqwest crate is a popular HTTP client for Rust.

By default, it doesn't send a user agent at all.

This can be confirmed by compiling the following

use reqwest::Client;
use std::collections::HashMap;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let _res = Client::new().get("http://192.168.3.5/foobla").send().await?;
  Ok(())
}

Which results in the following access log line on the target server

192.168.3.20 - - [28/Jan/2023:00:53:54 +0000] "GET /foobla HTTP/1.1" 404 292 "-" "-"

Developers are able to set a user-agent