lib.rs: mv http open logic to Request::write_request