packages/express-data-ssr/src/createFetch.js
function createRequest(url, req, { method, query } = {}) {
  const request = {
    url,
    method: method || 'GET',
    query: query || {},
  };

  return new Proxy(req, {
    set: (target, name, value, receiver) => {
      request[name] = value;
      return true;
    },
    get: (target, name) => {
      if (name in request) return request[name];

      switch (name) {
        // TODO:
        case 'next':
        case 'params':
        case 'baseUrl':
        case 'originalUrl':
        case '_parsedUrl':
          return undefined;

        default:
          return target[name];
      }
    },
  });
}
function createRequest(url, req, { method, query } = {}) {
  const request = {
    url,
    method: method || 'GET',
    query: query || {},
  };

  return new Proxy(req, {
    set: (target, name, value, receiver) => {
      request[name] = value;
      return true;
    },
    get: (target, name) => {
      if (name in request) return request[name];

      switch (name) {
        // TODO:
        case 'next':
        case 'params':
        case 'baseUrl':
        case 'originalUrl':
        case '_parsedUrl':
          return undefined;

        default:
          return target[name];
      }
    },
  });
}
function createRequest ( url , req , { method , query } = { } ) { const request = { url , method : method || 'GET' , query : query || { } , } ; return new Proxy ( req , { set : ( target , name , value , receiver ) => { request [ name ] = value ; return true ; } , get : ( target , name ) => { if ( name in request ) return request [ name ] ; switch ( name ) { // TODO: case 'next' : case 'params' : case 'baseUrl' : case 'originalUrl' : case '_parsedUrl' : return undefined ; default : return target [ name ] ; } } , } ) ; }
Creates a Proxy object for the request.

XXX: It only supports `GET`, but, will we need another method for SSR?

@param {String} url -
@param {Object} req - Express request object
@param {String} method - GET
@param {Object} query - Url query parameters

@return {Proxy} Request object
Creates a Proxy object for the request .