Fast and safe HTTP for the Rust language.

Get Started

hyper typed http

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

It is a low-level typesafe abstraction over raw HTTP, providing an elegant layer over "stringly-typed" HTTP.

Hyper offers both an HTTP client and server which can be used to drive complex web applications written entirely in Rust.

Hello, World

extern crate hyper;
extern crate service_fn;

use hyper::header::{ContentLength, ContentType};
use hyper::server::{Http, Response};
use service_fn::service_fn;

static TEXT: &'static str = "Hello, World!";

fn run() -> Result<(), hyper::Error> {
    let addr = ([127, 0, 0, 1], 3000).into();

    let hello = || Ok(service_fn(|_req|{
            .with_header(ContentLength(TEXT.len() as u64))

    let server = Http::new().bind(&addr, hello)?;

# fn main() {}