code: function flush() {
  		var temp = buffer;
  		buffer = [];
  		if (method === 'post') {
  			var postJson = {
  				schema: 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-0',
  				data: temp.map(valuesToStrings)
  			};
  			request.post({
  				url: targetUrl,
  				json: postJson,
  				agentOptions: agentOptions,
  				headers: {
  					'content-type': 'application/json; charset=utf-8'
  				}
  			}, callback);
  
  		} else {
  			for (var i=0; i<temp.length; i++) {
  				request.get({
  					url: targetUrl,
                      agentOptions: agentOptions,
  				 	qs: temp[i]
  				}, callback);
  			}
  		}
  	}
docs: Send all events queued in the buffer to the collector