Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HTTP Library: First iteration.


http://git.eigenstate.org/ori/libhttp.git/tree/

At the moment, the API is extremely basic, and only does synchronous stuff. An
example program also lives in the repository.

Use looks something like:

	use std
	use http

	const main = {
		var session, response

		session = std.try(http.mksession("some-hostname.com"))
		response = http.get("/index.html")
		for (key, val) in resp.hdrs
			std.put("{}: {}\n", key, val)
		;;
		std.put("{}\n", body)
		http.freeresp(response)
	}

API review would be welcome. Also, suggestions for what the server side of this
should look like would be great.

-- 
    Ori Bernstein