requests: one client API, reached through run
The eio facade carried two complete client APIs -- the session verbs and a One module duplicating every one of them -- so a caller had to know which of the two to reach for, and opening Requests_eio dumped thirty-two modules into scope, most of them pure vocabulary with no caller. The low-level driver added six request_ names fanning a single function over three optional axes, ending in request_100_continue_stream_decompress.
There is now one verb set, entered through run, which opens the switch and hands back a session; a one-shot is a session that ends with the scope. The driver is Requests_eio_h1.request, one name taking the axes as optional arguments and always streaming, so callers who want a string drain it. The facade carries the thirteen modules callers reach for, ordered session, core types, behaviour, low-level; the rest stay in the pure core. Routing the buffered callers onto the streaming path surfaced a live bug: a fixed-length body that ends early read back as complete, because sub stops at end of input, so a peer promising more than it sends went unnoticed.
requests: one client API, reached through run
The eio facade carried two complete client APIs -- the session verbs and a One module duplicating every one of them -- so a caller had to know which of the two to reach for, and opening Requests_eio dumped thirty-two modules into scope, most of them pure vocabulary with no caller. The low-level driver added six request_ names fanning a single function over three optional axes, ending in request_100_continue_stream_decompress.
There is now one verb set, entered through run, which opens the switch and hands back a session; a one-shot is a session that ends with the scope. The driver is Requests_eio_h1.request, one name taking the axes as optional arguments and always streaming, so callers who want a string drain it. The facade carries the thirteen modules callers reach for, ordered session, core types, behaviour, low-level; the rest stay in the pure core. Routing the buffered callers onto the streaming path surfaced a live bug: a fixed-length body that ends early read back as complete, because sub stops at end of input, so a peer promising more than it sends went unnoticed.