code: function httpRequest(options, result_schema, body) {
  
      if (body) {
         options['body'] = body;
      }
  
      const url = `http://${options.host}:${options.port}${options.path}`;
      return fetch(url, options)
      .then((response) => {
  
          if(response.status >= 500) {
             throw new Error(response.statusText);
          }
  
          if(response.status === 404) {
             return {'error': 'No such file or directory', 'errno': ENOENT};
          }
  
          if(response.status === 403) {
             return {'error': 'Access denied', 'errno': EACCES};
          }
  
          if(response.status === 401) {
             return {'error': 'Invalid request', 'errno': EINVAL};
          }
  
          if(response.status === 400) {
             return {'error': 'Operation not permitted', 'errno': EPERM};
          }
  
          let resp = null;
          if (response.headers.get('content-type') === 'application/json') {
             return response.json().then( (resp) => {
                return validateJSONResponse(resp, result_schema);
             });
          }
          else {
             return response.text();
          }
      });
  }
docs: /*
  Helper method to issue an HTTP request.
  @param options (Object) set of HTTP request options
  @param result_schema (Object) JSON schema of the expected result
  
  Returns a structured JSON response on success, conformant to the result_schema.
  Returns plaintext on success if the content-type is application/octet-stream
  Returns a structured {'error': ...} object on client-side error
  Throws on server-side error