Client reqwest, problem with ¿header? ¿referer? [Solved]

i'm using a client create with reqwest with this options:

[src/main.rs:329] cliente = Client {
accepts: Accepts,
proxies: [
Proxy(
System(
{},
),
None,
),
],
referer: true,
default_headers: {
"accept": "/",
},
}

when i use this client to get and image, i get a file of only 16bytes

when i use wget

wget https://zjcdn.mangahere.org/store/manga/23517/147.0/compressed/u001-f1725fa003d005e003ace88837844b006f123a007ac123345f007c005e004cec31000a003ff927060e.jpg
--2022-04-25 17:19:01-- https://zjcdn.mangahere.org/store/manga/23517/147.0/compressed/u001-f1725fa003d005e003ace88837844b006f123a007ac123345f007c005e004cec31000a003ff927060e.jpg
Resolviendo zjcdn.mangahere.org (zjcdn.mangahere.org)... 104.21.233.136, 104.21.233.135, 2606:4700:3038::6815:e987, ...
Conectando con zjcdn.mangahere.org (zjcdn.mangahere.org)[104.21.233.136]:443... conectado.
Petición HTTP enviada, esperando respuesta... 403 Forbidden
2022-04-25 17:19:01 ERROR 403: Forbidden.

i get 403, to solve this with wget i can do¡:

wget --referer Danberu nan kiro moteru? 147 - Read Danberu nan kiro moteru? Chapter 147 Online - Page 1 https://zjcdn.mangahere.org/store/manga/23517/147.0/compressed/u001-f1725fa003d005e003ace88837844b006f123a007ac123345f007c005e004cec31000a003ff927060e.jpg
--2022-04-25 17:19:20-- https://zjcdn.mangahere.org/store/manga/23517/147.0/compressed/u001-f1725fa003d005e003ace88837844b006f123a007ac123345f007c005e004cec31000a003ff927060e.jpg
Resolviendo zjcdn.mangahere.org (zjcdn.mangahere.org)... 104.21.233.136, 104.21.233.135, 2606:4700:3038::6815:e988, ...
Conectando con zjcdn.mangahere.org (zjcdn.mangahere.org)[104.21.233.136]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 198383 (194K) [image/jpeg]
Grabando a: «u001-f1725fa003d005e003ace88837844b006f123a007ac123345f007c005e004cec31000a003ff927060e.jpg»

u001-f1725fa003d005e003ace 100%[======================================>] 193,73K 214KB/s en 0,9s

2022-04-25 17:19:21 (214 KB/s) - «u001-f1725fa003d005e003ace88837844b006f123a007ac123345f007c005e004cec31000a003ff927060e.jpg» guardado [198383/198383]

But how i can put this header in the client of the reqwest?

i'm not sure if i can't use the default client of the reqwest, many thanks in advance

The Referer header can be set using the RequestBuilder::header() method:

use reqwest::Client;

#[tokio::main]
async fn main() {
    let response = Client::new()
        .get("https://httpbin.org/headers")
        .header("Referer", "https://example.com/")
        .send()
        .await
        .unwrap();
    println!("{}", response.text().await.unwrap());
}

Alternatively, it can be set in the Client with ClientBuilder::default_headers():

use reqwest::{header::HeaderMap, Client};

#[tokio::main]
async fn main() {
    let mut headers = HeaderMap::new();
    headers.insert("Referer", "https://example.com/".parse().unwrap());
    let client = Client::builder().default_headers(headers).build().unwrap();
    let response = client
        .get("https://httpbin.org/headers")
        .send()
        .await
        .unwrap();
    println!("{}", response.text().await.unwrap());
}