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
0 answers

Rust crypto api 401 error returned. Kucoin

I'm attempting to use reqwest to connect to the kucoin api. I've adapted it to Kucoin's configuration from my Bybit implementation. I'm using the https://github.com/escwdev/kucoin_rs/blob/a79a0a08d1bf3dbca781a97bd9e15f645bef4a62/src/kucoin/client.rs…
Escork
  • 1
  • 1
0
votes
0 answers

How to resolve a Rust Reqwest Error: Invalid Certificate

Quick question, does reqwest allow self-signed certificates? I have created a tls enabled rust-warp webserver. And I have created a reqwest client to make requests to this server for testing purposes. The cert added to add_root_certificate is the…
0
votes
2 answers

How do I handle ToManyRedirects panicks in Rust?

I have a Rust project that use the "reqwest" crate and has the below function: fn elem_html_vec(url: &String, element: &str, vec_elem: &mut Vec) { let response: String = get(url) .expect("Could not load URL.") .text() …
Saad
  • 33
  • 5
0
votes
2 answers

variable in reqwest http get request

Im trying to make a program in rust that will send a http req with reqwest for every line in a file, and have that line be apart of the get request. use std::io::{self, prelude::*, BufReader}; fn main() -> io::Result<()> { let file =…
sxtj
  • 1
  • 1
0
votes
0 answers

Rust reqwest::Error { kind: Builder, source: http::Error(InvalidHeaderValue) }

I'm new to Rust and I'm trying to use the Reqwest library to construct an HTTP request containing two custom headers and the respective values. The functions I wrote for this are as follows: async fn oauth_request(server_address: &str, user_id:…
GTP95
  • 13
  • 4
0
votes
0 answers

Hyper v0.14 : http2 error: stream error sent by user: unexpected internal error encountered

hyper::Client.request() occationally raises the following error in my http reverse proxy when forwarding an HTTP2 request. http2 error: stream error sent by user: unexpected internal error encountered I am trying to find the cause of this error in…
Mr.Wang from Next Door
  • 13,670
  • 12
  • 64
  • 97
0
votes
0 answers

Using json() with response data in reqwest is slow

I am trying to obtain an HTTP response asynchronously, but the speed is slow. I am not sure if the asynchronous approach is successful. Removing json::().await can make it faster, but then won't be able to get the returned…
Scc
  • 446
  • 5
  • 4
0
votes
0 answers

Post a tar archive in a reqwest function

Hi i want to send a tar archive with a docker image to docker build api. this is an example of how i am triyng to post that // build image pub fn build_image_fn(docker_api_ip: &str, image_name: &str, img_file_path: &str) -> Result { …
GranBoh
  • 67
  • 8
0
votes
1 answer

cannot move out of `*response` which is behind a shared reference with Rust while parsing a json response

I'm a newbie that is trying to make a simple email parser, but I'm facing the usual newcomers' problems with the borrowing stuff in Rust. I'm trying to make compile the following code that wants to parse a json response with reqwest into my struct…
exrezzo
  • 497
  • 1
  • 5
  • 24
0
votes
1 answer

What's causing the 'API rate limit exceeded' error in Rust's Reqwest even though I've included my Github token?

Although the code has the Github token included, for some reason I am still unable to avail more GitHub Rest API quota. I am using Reqwest for Rust to process all requests. I believe that I may be entering my token incorrectly. The Code let…
0
votes
1 answer

get method of the reqwest crate not working

pub struct TestApp { pub address: String, pub pool: PgPool, } async fn spawn_app() -> TestApp { let listener = TcpListener::bind("127.0.0.1:0").expect("failed to bind to the port"); let port = listener.local_addr().unwrap().port(); …
0
votes
1 answer

How to Deserialize JSON Response in Rust without Moving the Response Object?

Context I'm building a small Rust CLI to automate some tasks in Gitlab. I'm using reqwest to send my HTTP requests to the Gitlab API. I'm currently refactoring my code, and now I would like to remove this duplicated code snippet. fn main() { //…
Jeremy
  • 1,447
  • 20
  • 40
0
votes
0 answers

Rust: POST request to Google CrunchBase API

I need help sending a POST request to Google CrunchBase. I use Rust, its reqwest crate and basic Google CrunchBase API. Please find my source code below: // import necessary crates use reqwest::header::{CONTENT_TYPE, ACCEPT}; use…
mabalenk
  • 887
  • 1
  • 8
  • 17
0
votes
0 answers

Can't assign requested address in request

I am testing a web api using the reqwest crate. I get the following error after a certain number of requests. thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Request, url: Url { scheme: "http",…
musako
  • 897
  • 2
  • 10
  • 26
0
votes
1 answer

Actix Web streaming with reqwest: Duration not sent

I have the problem that the example of the actix web streaming proxy is not working as expected. You can find my code below. What I want to achieve: Stream an mp3 from another server from my backend so I can get around CORS and handing over the IP…
SamTV
  • 147
  • 1
  • 11