lib/sjmp.js
function request(packet, json) {
  return _create(packet, 1, (METHODS[packet.method] || '') + packet.resource, json);
}
function request(packet, json) {
  return _create(packet, 1, (METHODS[packet.method] || '') + packet.resource, json);
}
function request ( packet , json ) { return _create ( packet , 1 , ( METHODS [ packet . method ] || '' ) + packet . resource , json ) ; }
Serialize request to array or JSON.

@param {Object}        packet
@param {String}        packet.resource
@param {String}        packet.id
@param {*}             packet.body
@param {Number|String} [packet.date]
@param {Object}        [packet.headers]
@param {String}        [packet.method] "get", "search", "post", "put", "delete", "sub", "unsub".
@param {Boolean}       [json] true to generate JSON instead of array.
@returns {Array|String|null}
Serialize request to array or JSON .