Questions tagged [reqwest]

reqwest is a high-level Rust HTTP client library that aims to be convenient and capable.

Documentation is available at https://docs.rs/reqwest/latest/reqwest/

215 questions
0
votes
1 answer

How to remove TLS dependencies from reqwest?

I am planning to do GET/POST methods using the reqwest library. Unfortunately, I don't want to have any TLS dependencies: no openssl, native-tls, rust-nativetls, etc. How can I disable it?
0
votes
0 answers

Why I get 0 for Content-Length() when getting Http response from yahoo if I set Mozilla/5.0 user-agent?

I'm trying to get to scrap all links from yahoo.com and get the size of the page itself. If I set User-Agent = "Mozilla/5.0" to my HTTP request, I would be able to scrap all links but my content-length would be 0. let client =…
0
votes
1 answer

Rust Http Request with reqwest for specific website returns error

I'm trying to send http GET request with Rust using reqwest crate. Following code works: extern crate reqwest; fn main() -> Result<(), Box> { let resp =…
BIlguun Zorigt
  • 425
  • 1
  • 9
  • 15
0
votes
1 answer

Why does my asynchronous request pool (using crossbeam channels) block?

My main goal is to write an API Server, which retrieves part of the information from another external API server. However, this API server is quite fragile, therefore I would like to limit the global amount of concurrent requests made to those…
whati001
  • 317
  • 2
  • 9
0
votes
1 answer

Use simd-json with reqwest

How can one get the Rust reqwest library to parse json via simd-json? I believe the current default is serde_json. reqwest::get("https://www.example.com").await.json().await If it is impossible, how does one make a web request and parse with…
Test
  • 962
  • 9
  • 26
0
votes
1 answer

storing response from paginated api in rust

I am trying to call a paginated API with the code below. When I call it without the next-token (i.e. no loop), I can count the number of balances i.e. response.balances.len(). #[derive(Deserialize, Debug, Clone)] pub struct Algoholder { …
0xsegfault
  • 2,899
  • 6
  • 28
  • 58
0
votes
0 answers

Trouble building a valid request for dropbox that succeeds with curl

I've been using reqwest for a few months now; solid features, reuse of types defined in http (and the like) and documentation. I have the following http post request that works in Postman and curl that for reasons I can't figure out, generates a…
Edmund's Echo
  • 766
  • 8
  • 15
0
votes
1 answer

expected struct `Vec`, found enum `Result` in tokio, cacache and match

I find it difficult to understand what's wrong with the below code. I'm getting expected struct Vec, found enum Result error at Ok(from_cache), but I have adopted the code from…
Rajesh
  • 17
  • 6
0
votes
1 answer

Reading response into bytes takes forever

I am trying to download a file using reqwest. The response status is 200. At the line when I am trying to read the response as bytes response.bytes().await? it waits forever. However, when I try to make a curl request for the same URL, it passes and…
Surya
  • 2,429
  • 1
  • 21
  • 42
0
votes
0 answers

What is happening in the response body of my http request?

I have a post request that when sent in python through the requests or aiohttp library, responds as expected, but when the equivalent request is sent in rust through the reqwest library, is pure gibberish. The request: pub async fn get_token(client:…
0
votes
1 answer

How to sort JSON in rust?

Is it possible to sort JSON in rust language? If it is possible then how? Like this one: const headers = { 'checkout-account': '1234', 'checkout-algorithm': 'sha256', 'checkout-method': 'POST', 'checkout-nonce': '564635208570151', …
chifmaster113
  • 13
  • 1
  • 1
0
votes
0 answers

Obtaining data in a request in rust

When I request data off a website https://unqnft.io/#/market or https://unqnft.io/#/trades, in the text there is a ton of content missing. The page seems to be fetching the data from elsewhere. use scraper::{Html, Selector}; error_chain! { …
TrapLordOb
  • 25
  • 4
0
votes
2 answers

How to POST a multipart form using async version of reqwest crate?

The documentation for https://docs.rs/reqwest/latest/reqwest/blocking/multipart/struct.Form.html shows this example to create a multipart::Form from a file. let file = reqwest::blocking::multipart::Form::new().file("key", "/path/to/file")?; …
Iago Passos
  • 1
  • 1
  • 1
0
votes
1 answer

Why does route not compile when returning non-Responder error in Rocket?

The Rocket documentation says this: If the error type E does not implement Responder, then the error is simply logged to the console, using its Debug implementation, and a 500 error is returned to the client. I have a route with this signature,…
Alper
  • 3,424
  • 4
  • 39
  • 45
0
votes
0 answers

Why can't I see the send action?

I am using reqwest in rust to do a simple POST action: let client = reqwest::blocking::Client::new(); let file = File::open("somefile"); let res = client .post("http://127.0.0.1:5001/api/v0/add") .body(file) .send()?; I got 400…
Magicloud
  • 818
  • 1
  • 7
  • 17