Commit Briefs

ab6adf11f9 Murilo Ijanc

add multipart/form-data body builder (main)



ce35e7331a Murilo Ijanc

add link.mk declaring native libs needed by consumers


72e29eb33e Murilo Ijanc

add examples/post for POSTing a body to a URL

- body from argv or stdin (-), sent as application/json - prints response status line, headers, and body


ebd3a89fa7 Murilo Ijanc

add HTTPS client, parsers, and chunked transfer-coding

- Method / Version / Status (is_* predicates, canonical reason phrases) and case-insensitive ordered Headers - parse_request and parse_response_head per RFC 2616 §5/§6, accepting bare LF (§19.3) and obs-fold (§2.2) - response_body_length / request_body_length covering the §4.4 matrix - ChunkedReader / ChunkedWriter per §3.6.1 for SSE-style streaming - RequestBuilder + top-level get/head/post/put/delete/patch/request; send() returns a Response that implements Read, with Host, User-Agent, Connection: close, and Content-Length auto-set - TlsStream wraps libtls and propagates -ltls via #[link] - percent_encode, percent_decode, url_form; RequestBuilder::form - examples/get.rs and 34 inline tests


7e68a5d052 Murilo Ijanc

add examples/ and expose VERSION const

Populate VERSION from the HTTP_VERSION environment variable which make already passes to rustc, so downstream crates can print or log the library version without a second source of truth. Add examples/hello.rs, a minimal binary that links against the rlib and prints the version. A generic Makefile pattern rule builds any file under examples/ into build/ex-<name>, driven by the new examples target.


2625e3b992 Murilo Ijanc

initial import of http, a single-file HTTP library


Branches

Tags

This repository contains no tags

Tree

.gitignorecommits | blame
.rustfmt.tomlcommits | blame
LICENSEcommits | blame
Makefilecommits | blame
README.mdcommits | blame
examples/
http.rscommits | blame
link.mkcommits | blame

README.md

http - minimal HTTP/1.0 and HTTP/1.1 library
=============================================
http is a minimal, single-file HTTP library written in Rust, conforming
to RFC 1945 (HTTP/1.0) and RFC 2616 (HTTP/1.1).  It is meant to be
dropped into another project's source tree, or linked as a plain rlib.


Requirements
------------
In order to build http you need rustc (edition 2024).


Installation
------------
There are two ways to use http in another Rust project.

Drop-in source.  Copy http.rs into your project and declare it as a
module:

    mod http;

Linked rlib.  Build the library with make(1) and pass it to rustc:

    $ make
    $ rustc --extern http=build/libhttp.rlib -L build main.rs


Standards
---------
- RFC 1945 (HTTP/1.0)
- RFC 2616 (HTTP/1.1)


Download
--------
    got clone ssh://anon@ijanc.org/http
    git clone https://git.ijanc.org/http.git


License
-------
ISC - see LICENSE.