Skip to content

Latest commit

 

History

History
 
 

examples

Examples of using hyper

Run examples with cargo run --example example_name.

Available examples

  • client - A simple CLI http client that request the url passed in parameters and outputs the response content and details to the stdout, reading content chunk-by-chunk.

  • echo - An echo server that copies POST request's content to the response content.

  • hello - A simple server that returns "Hello World!" using a closure wrapped to provide a Service.

  • multi_server - A server that listens to two different ports, a different Service by port, spawning two futures.

  • params - A webserver that accept a form, with a name and a number, checks the parameters are presents and validates the input.

  • send_file - A server that sends back content of files either simply or streaming the response.

  • web_api - A server consisting in a service that returns incoming POST request's content in the response in uppercase and a service that call that call the first service and includes the first service response in its own response.