hyper Questions
3
Solved
This question has several answers (here, here, and here), but none of them worked for me :(
What I've tried so far:
use hyper as http;
use futures::TryStreamExt;
fn test_heartbeat() {
let mut...
Yangyangtze asked 7/8, 2020 at 12:24
4
Solved
I want to write a server using the current master branch of Hyper that saves a message that is delivered by a POST request and sends this message to every incoming GET request.
I have this, mostly...
Tuft asked 14/4, 2017 at 22:21
4
Solved
If you have any experience with the downloadable software "Hyper" which is basically just a terminal, then you might be able to help me. I can't change the theme, its look. I am on the ne...
1
Solved
For example, when user access http://127.0.0.1:8080/hello, if query parameter id is 1, a plain text response return. If id is 2, give a JSON structure.
Summary:
id (input)
status code
content-ty...
1
Solved
I'm trying to add a request id to each tracing event. I can do it with tower_http::trace like this:
#[derive(Clone)]
pub struct RequestSpan;
impl<B> tower_http::trace::MakeSpan<B> for ...
Vannavannatta asked 25/9, 2021 at 18:17
2
Solved
I'm trying to post an image file using hyper like cURL does:
curl -F [email protected] https://httpbin.org/post --trace-ascii -
The result is:
{
"args": {},
"data": "",
"files": {
"smf...
1
I'm writing a "hello world" HTTP server with Hyper, however I am not able to find the Server and rt modules when trying to import them.
When invoking cargo run, then I see this error mess...
2
Solved
How do I set a timeout for HTTP request using asynchronous Hyper (>= 0.11)?
Here is the example of the code without timeout:
extern crate hyper;
extern crate tokio_core;
extern crate futures;
us...
Myra asked 25/7, 2017 at 20:40
1
Solved
This is the continuation of `RefCell<std::string::String>` cannot be shared between threads safely?, made a new Q for better presentation.
I made a minimal main with a Mutex, but now test_for...
2
Solved
This is a continuation of How to re-use a value from the outer scope inside a closure in Rust? , opened new Q for better presentation.
// main.rs
// The value will be modified eventually inside `...
1
Solved
I am trying to add a webserver (hyper) in a small Rust program and I'm getting hit with a move issue.
//main.rs
// Suppose this is something meaningful and used in multiple places inside `main`
...
1
I am having trouble passing additional state to my service function, but I can't sort out the lifetimes in the closures. None of the tutorials seem to address it:
https://hyper.rs/
https://docs.r...
Preece asked 2/4, 2020 at 16:31
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...
1
ps: the answer below helped but it's not the answer I need, I have a new problem and I edited the question
I'm trying to make a custom transporter for the hyper http crate, so I can transport http ...
3
Solved
I'm trying to parse the HTML response of an HTTP request. I'm using hyper for the requests and html5ever for the parsing. The HTML will be pretty large and I don't need to fully parse it -- I just ...
1
Solved
I am trying to write a test program with tokio that grabs a file from a website and writes the streamed response to a file. The hyper website shows an example that uses a while loop and uses the .d...
Congenital asked 1/4, 2020 at 5:29
1
Solved
I am trying to send a hyper response with a specific number of bytes and chunks. I've been lost on how to generate a generic chunked response or set the transfer-encoding header. There seemed to be...
1
Solved
I am trying to implement implement HTTPS server using Rustls with Hyper, but am not able to get proper example of how to implement the same. And for that i have followed and tried example given on ...
3
Solved
I tried to display the content (body) of an URL as text using Hyper
extern crate hyper;
use hyper::client::Client;
use std::io::Read;
fn main () {
let client = Client::new();
let mut s = Stri...
1
I have a library which uses hyper internally. I want the user to be able to create an Appwhich contains a Server internally that handles HTTP connections.
use hyper::server::conn::AddrIncoming;
us...
1
I'm trying to make a webserver that accepts some parameters as JSON, and turns them into a struct which I'll then store somewhere else in my app.
I have this data struct in a file called status.rs...
1
How do I send an HTTP request using a proxy with Hyper 0.11? I have the following working code that sends an HTTP request without proxy:
extern crate hyper;
extern crate tokio_core;
extern crate f...
1
Solved
I'm trying to create a counter in a Hyper web server that counts the number of requests it has received. I'm using a Arc<Mutex<u64>> to hold onto count. However, I haven't been able to ...
Megdal asked 24/10, 2018 at 16:39
1
Solved
I'm building a service that periodically makes an HTTP request. I'm using tokio::timer::Delay as a periodic trigger and hyper to make the HTTP call.
Using them together gives me the following erro...
Jedediah asked 1/6, 2018 at 13:46
1
Solved
I am stuck, below is the JSON which I am receiving:
{
"BCH": {
"aclass": "currency",
"altname": "BCH",
"decimals": 10,
"display_decimals": 5
}
}
I am bit confused on how my struct should l...
Estevez asked 6/9, 2017 at 11:44
1 Next >
© 2022 - 2025 — McMap. All rights reserved.