reqwest Questions
2
Solved
I'm attempting to copy a file downloaded with reqwest in to a tokio file. This file is too large to store in memory so it needs to be through the bytes_stream() rather than bytes()
I had attempted ...
Chivalric asked 2/11, 2022 at 0:22
2
I need to issue a long sequence of REST calls to the same server (let's call it myapi.com). At the moment, I am using the Rust library reqwest as follows:
I create a reqwest::Client with all defau...
2
Solved
I am attempting to do a post using the reqwest library and following patters that I have found in various places online:
let res = http_client.post(&url)
.header("Content-Type", "application/...
1
I'm decoding a reqwest::Response to JSON. Usually that works fine, but in some rare cases the remote server returns a response that doesn't fit my struct that I'm using for deserialization. In thos...
3
Solved
The documentation for reqwest v0.9.18 shows the following example of posting a file:
let file = fs::File::open("from_a_file.txt")?;
let client = reqwest::Client::new();
let res = client.p...
3
I need to download a 60MB ZIP file and extract the only file that comes within it. I want to download it and extract it using streams. How can I achieve this using Rust?
fn main () {
let mut res ...
1
Solved
I am querying an API for some data but their keys have hyphens instead of underscores in their names, and since I can't have hyphens in struct field names, I am unable to cast it.
For example, my s...
Suburban asked 2/3, 2022 at 20:49
1
From the reqwest docs, you can get the deserialized json, or the body text from a request response.
What I can't see is how to get them both. My requirement is that I want the decoded json for use ...
1
Solved
I'm trying to send a GET request to the Binance API. But I'm getting this output in my terminal instead of the data:
Response { url: Url { scheme: "https", cannot_be_a_base: false, userna...
2
Solved
The async example is useful, but being new to Rust and Tokio, I am struggling to work out how to do N requests at once, using URLs from a vector, and creating an iterator of the response HTML for e...
Janessa asked 26/6, 2018 at 13:46
2
Solved
I'm learning rust and trying to scrape a random site by sending some POST data, and I'm getting a bunch of errors like:
error[E0277]: the `?` operator can only be used in an async block that return...
1
Solved
I've been messing around with HTTP over the past few days by building a simple CL download manager in Rust using the reqwest crate to handle the HTTP stuff. I've got a basic understanding of how th...
1
Solved
I'm building a web server with Actix-web and one of the methods uses reqwest to make HTTP requests to an external API:
#[get("/foo")]
async fn foo() -> impl Responder {
let resp = req...
1
Solved
According to the docs on Hyper.rs,
If you are looking for a convenient HTTP client, then you may wish to consider reqwest. If you are looking for a convenient HTTP server, then you may wish to con...
2
Solved
I'm trying to implement this curl call using the Rust crate reqwest:
curl -u [USERNAME]:[PASSWORD] -H "Content-Type: application/json" -d @content.json [WEBSITE]
The file content.json en...
1
I'm using reqwest = { version = "0.11", features = ["json"] }
impl Client {
pub fn new(/*endpoint: Url*/) -> Result<Client> {
Ok(Client {
client: reqwest::Clie...
1
Solved
I'd like to use a type returned by a function in crate A that is actually defined in crate B, but crate A doesn't reexport it.
Although I can explicitly add crate B in my Cargo.toml, I'm not sure h...
1
Solved
When I run the following code:
use exitfailure::ExitFailure;
use reqwest::Url;
use serde_derive::{Deserialize, Serialize};
use std::env;
#[derive(Serialize, Deserialize, Debug)]
struct CompanyInfo...
Goodspeed asked 17/1, 2021 at 6:15
3
Solved
When building my Rust lambda using cross, I get this error:
error: failed to run custom build command for `openssl-sys v0.9.58`
When I look at my dependency graph, openssl isn't even listed! How i...
Selfreliant asked 30/11, 2020 at 18:43
3
I have an actix endpoint, and I need to do a synchronous http client fetch to get some results, and return some data. My endpoints cannot use async, so I can't use any .await methods.
I've tried u...
1
Solved
I'm trying to use parts of this Python script (taken from here) in a Rust program I'm writing. How can I construct a reqwest request with the same content?
def login(login_url, username, password=N...
Weigle asked 13/9, 2020 at 16:32
1
Solved
I am totally new to rust and I am trying to find out how to I can doload an deserialize a arbitrary JSON structure from a URL endpoint.
The respective example on the reqwest README goes like this:
...
1
Solved
i get the following error while creating this POST request. Im a newbie in RUST.
Instead of serde_json::Value I have even tried HashMap<String, String> still the same issue.
if you could tell...
Lawrenson asked 27/8, 2020 at 14:53
1
Solved
I'm trying to download and save a Zip file. It seems like the download is working, but the saving goes wrong. If I try to unzip the file, I get the following error:
Archive: download.zip
erro...
1
Solved
I cannot return a result of a function from a Result. Every tutorial only shows how to use a Result, but not how to return a value from it.
fn main(){
let mut a: Vec<String> = Vec::new();
a...
Kisor asked 30/6, 2020 at 10:41
1 Next >
© 2022 - 2025 — McMap. All rights reserved.