Questions tagged [hyper]

A fast and correct HTTP implementation for Rust.

Hyper is a fast, safe HTTP implementation written in and for Rust.

  • A Client for talking to web services.
  • A Server for building those web services.
  • Blazing fast* thanks to Rust.
  • High concurrency with non-blocking sockets.
  • HTTP/1 and HTTP/2 support.

Github Repository

Guide

256 questions
1
vote
1 answer

Can't pass closure to `Hyper::service_fn`

I want to write a simple microservice with hyper: use hyper::service::{make_service_fn, service_fn}; use hyper::{Body, Request, Response, Server}; use hyper::{Method, StatusCode}; use std::{convert::Infallible, net::SocketAddr}; struct ApiServer…
milo
  • 1,220
  • 3
  • 17
  • 33
1
vote
0 answers

Why do Rust HTTP libraries implement both request and response body as something to read?

After reviewing several HTTP implementations in Rust I realized that all of them seem to implement message body as "something to read". For example, all of these are used as both request AND response…
1
vote
1 answer

Return a struct from a body stream

Please assist, i have looked at the hyper doc and example Most examples when dealing with hyper Request will either map(|chunk|{ //do something }) or and_then(|chunk|{ //do something }) then return the Stream, that works but now i want to try…
Silva
  • 625
  • 1
  • 6
  • 25
1
vote
1 answer

ZSH prompt starts with a percent sign on Hyper terminal

I'm using Hyper as my terminal on Linux Mint 19.2 and I've just installed ZSH with Oh My ZSH. when I open Hyper, a percentage sign appears before the prompt.
1
vote
1 answer

Why does using a cloned hyper client with Tokio futures in a loop block even after the future resolves?

I have a service which updates cache data on a fixed interval. Every N seconds it will trigger a future using a loop (tokio::run(future_update(http_client.clone()))), but it is not returned to the parent function where the future resolved. The loop…
Jarvis42
  • 61
  • 1
  • 7
1
vote
1 answer

How to send http 2.0 pseudo headers in python3

Basically i tried sending http2.0 headers with hyper for python https://hyper.readthedocs.io/en/latest/ https://github.com/python-hyper/hyper Mounting HTTP20Adapter in my request.session but didnt worked as expected. First i explain thath "from…
1
vote
1 answer

Can't read a simple payload making HTTP request via hyper::client::Client: the trait bound `Body: Future` is not satisfied

I am attempting to convert a Result to a Buffer: let ufc_root: String = String::from("https://www.ufc.com/athletes/all?filters%5B0%5D=status%3A23"); // let ufc_root: String = String::from("https://www.google.com"); let https =…
saxman
  • 21
  • 3
1
vote
0 answers

emoji in hyper terminal for windows

I am new to windows and previously used to work on mac, I am starting to hit a roadblock that is - I am unable to see emojis in windows hyper terminal or even the command prompt, any way we could render emojis screenshot of hyper terminal in…
1
vote
0 answers

How to extract the data from a hyper POST request?

I'm trying to make a small application that'll run as a webserver that accepts GET and POST requests. I've got it up and running and it accepts both requests, but I don't know how to extract the data from a POST request. Here's the code to get the…
1
vote
1 answer

Cannot move out of borrowed content trying to deserialize hyper::Request.body()

I'm trying to parse a request body to a strongly typed object using serde_json: #[macro_use] extern crate serde_derive; // 1.0.70 extern crate futures; // 0.1.23 extern crate hyper; // 0.12.7 extern crate serde_json; // 1.0.24 use…
AunAun
  • 1,423
  • 2
  • 14
  • 25
1
vote
2 answers

vim color schemes not rendering background color

Tried solutions: adding export TERM=xterm-256color to .bashrc and .zshrc and also adding set t_Co=256 to .vimrc as pointed out in the solutions to other questions. Yes, I am using a color scheme that supports both the gui and the terminal it is…
J. Doe
  • 43
  • 2
  • 9
1
vote
0 answers

Loading Vim with Hyper on Windows 10 leaves extra characters

I'm using Vim through git-bash on Windows 10 and anytime I fire up a Vim window, it leaves the characters from the screen before it on the page. Windows 10 Hyper git-bash Screen before I launch vim Screen after I launch vim
1
vote
1 answer

Client certificate in Rust using Hyper

I have been writing a client in Rust which makes a request to a server with a client certificate (Pkcs12). Although this has been answered How to make a request with client certificate in Rust, the code doesn't compile as it is. If I make some…
Rahul Gurnani
  • 174
  • 1
  • 13
1
vote
1 answer

How to send a POST request to an HTTP2 with Hyper

I just want to send a post request to submit a form to a website who only use h2 protocol. import requests from hyper.contrib import HTTP20Adapter import hyper session = requests.session() session.mount(url, HTTP20Adapter()) r =…
1
vote
1 answer

How do I use a Hyper client within a MPSC receiver?

I've got an application which pulls items off a queue in a callback. The callback is in a separate thread, so I can't do any of this directly in the callback. The items on the queue include a URL and a message body to be POSTed to the URL. Based on…
Jack Lund
  • 131
  • 1
  • 6