http4r-core

Crates.iohttp4r-core
lib.rshttp4r-core
version0.0.6
sourcesrc
created_at2022-02-24 11:13:28.192477
updated_at2022-03-20 13:17:15.992022
descriptionSimple, synchronous, symmetric client and server as a function
homepagehttps://http4r.com/
repositoryhttps://github.com/TomShacham/http4r
max_upload_size
id538441
size79,487
Tom Shacham (TomShacham)

documentation

https://htt4p4r.com/docs

README

http4r

Core

The main contract and functionality of http4r.

  • Handler, Server and Client
  • Writing/reading http messages to/from wire
  • Immutable Request, Response, Uri, Headers, Query etc.
  • Supports simple messages, streams, compression and chunked encoding
  • Coming soon: multipart, x-www-form-urlencoded

Philosophy

  • Simplicity:
    • Prefer a simple synchronous abstraction over http
    • Extension by composition not configuration
  • Minimalism:
    • use as few dependencies as possible to reduce surface area, crate size and upgrade complexity
    • do not publish convenience functions etc. rather share recipes in the docs
  • Compatibility:
    • try to maintain backwards compatibility
    • but unlike Rust itself, prefer to break it over keeping a hamstring-ing abstraction
      • to reduce the likelihood of this, do not publish convenience functions as mentioned above!

About

  • http4r is based on Dan's projects utterlyidle and http-handler.rust and http4t by Matt and is based on http4k inspired by Mr Dave and Ivan Sanchez
  • it is based on Server as a Function:
    • composable http handlers implement (Request) -> Response

    • immutable Request, Response, Headers etc

    • zero magic or reflection, stupidly simple and zero dependencies

    • easily test over the wire or rather in-memory

    • can test in-browser (not over the wire!) by compiling your app to WASM so we can write lightning-fast tests for our front end

GPL Copyright

http4r is a web toolkit Copyright (C) 2021-onwards Tom Shacham

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see COPYING). If not, see https://www.gnu.org/licenses/.

Contributing

I'm new to Rust or I'm a bit rusty

Look at the contributing guidelines at http4r

Commit count: 233

cargo fmt