port of em-http-request to ZMachine