code: function setHeaders(req, headers) {
          var i;
          for (i = 0; i < headers.length; ++i) {
              req.setRequestHeader(headers[i][0], headers[i][1]);
          }
      }
docs: Set XHR headers
  @param {XMLHttpRequest} req The request object
  @param {Array} headers      Array of headers to set