superagent 3.5.3-beta.2 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/superagent.js CHANGED
@@ -124,7 +124,7 @@ RequestBase.prototype.serialize = function serialize(fn){
124
124
  *
125
125
  * Value of 0 or false means no timeout.
126
126
  *
127
- * @param {Number|Object} ms or {response, read, deadline}
127
+ * @param {Number|Object} ms or {response, deadline}
128
128
  * @return {Request} for chaining
129
129
  * @api public
130
130
  */
@@ -1091,7 +1091,7 @@ request.getXHR = function () {
1091
1091
  try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {}
1092
1092
  try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {}
1093
1093
  }
1094
- throw Error("Browser-only verison of superagent could not find XHR");
1094
+ throw Error("Browser-only version of superagent could not find XHR");
1095
1095
  };
1096
1096
 
1097
1097
  /**
@@ -1201,7 +1201,7 @@ request.parseString = parseString;
1201
1201
  request.types = {
1202
1202
  html: 'text/html',
1203
1203
  json: 'application/json',
1204
- xml: 'application/xml',
1204
+ xml: 'text/xml',
1205
1205
  urlencoded: 'application/x-www-form-urlencoded',
1206
1206
  'form': 'application/x-www-form-urlencoded',
1207
1207
  'form-data': 'application/x-www-form-urlencoded'
@@ -1557,10 +1557,10 @@ Request.prototype.auth = function(user, pass, options){
1557
1557
  this.username = user;
1558
1558
  this.password = pass;
1559
1559
  break;
1560
-
1560
+
1561
1561
  case 'bearer': // usage would be .auth(accessToken, { type: 'bearer' })
1562
1562
  this.set('Authorization', 'Bearer ' + user);
1563
- break;
1563
+ break;
1564
1564
  }
1565
1565
  return this;
1566
1566
  };
@@ -1839,7 +1839,7 @@ request.get = function(url, data, fn){
1839
1839
  request.head = function(url, data, fn){
1840
1840
  var req = request('HEAD', url);
1841
1841
  if ('function' == typeof data) fn = data, data = null;
1842
- if (data) req.send(data);
1842
+ if (data) req.query(data);
1843
1843
  if (fn) req.end(fn);
1844
1844
  return req;
1845
1845
  };