docs: function requestJson(options, callback) {
    const proto = options.protocol === 'https:' ? https
      : options.protocol === 'http:' ? http
        : null;
    if (!proto) {
      callback(
        new Error(`Unsupported protocol "${options.protocol}" for validator URL`)
      );
      return;
    }
  
    const req = proto.request(options)
      .once('error', callback)
      .once('response', (res) => {
        res.on('error', callback);
        const bodyData = [];
        res.on('data', (data) => { bodyData.push(data); });
        res.on('end', () => {
          const resBody = Buffer.concat(bodyData);
          let err, resBodyObj;
          try {
            resBodyObj = JSON.parse(resBody.toString());
          } catch (errJson) {
            err = new SyntaxError(
              `Error parsing server response as JSON: ${errJson.message}`
            );
          }
  
          if (res.statusCode >= 300) {
            let errMessage = `HTTP ${res.statusCode}`;
            if (res.statusMessage) {
              errMessage += `: ${res.statusMessage}`;
            }
            err = new Error(errMessage);
          }
  
          if (err) {
            err.statusCode = res.statusCode;
            err.statusMessage = res.statusMessage;
            err.headers = res.headers;
            err.trailers = res.trailers;
            err.body = resBodyObj !== undefined ? resBodyObj : resBody;
            callback(err);
          } else {
            callback(null, resBodyObj);
          }
        });
      });
  
    const {body} = options;
    if (typeof body === 'string' || Buffer.isBuffer(body)) {
      req.end(body);
    } else {
      body.on('error', (err) => {
        req.abort();
        callback(err);
      });
      body.pipe(req);
    }
  }