function parseString(str) {
  var obj = {};
  var pairs = str.split('&');
  var pair;
  var pos;

  for (var i = 0, len = pairs.length; i < len; ++i) {
    pair = pairs[i];
    pos = pair.indexOf('=');
    if (pos == -1) {
      obj[decodeURIComponent(pair)] = '';
    } else {
      obj[decodeURIComponent(pair.slice(0, pos))] =
        decodeURIComponent(pair.slice(pos + 1));
    }
  }

  return obj;
}
Initialize a new `Response` with the given `xhr`.

 - set flags (.ok, .error, etc)
 - parse header

Examples:

 Aliasing `superagent` as `request` is nice:

     request = superagent;

 We can use the promise-like API, or pass callbacks:

     request.get('/').end(function(res){});
     request.get('/', function(res){});

 Sending data can be chained:

     request
       .post('/user')
       .send({ name: 'tj' })
       .end(function(res){});

 Or passed to `.send()`:

     request
       .post('/user')
       .send({ name: 'tj' }, function(res){});

 Or passed to `.post()`:

     request
       .post('/user', { name: 'tj' })
       .end(function(res){});

Or further reduced to a single call for simple cases:

     request
       .post('/user', { name: 'tj' }, function(res){});

@param {XMLHTTPRequest} xhr
@param {Object} options
@api private