HISTORY.md
Please see GitHub releases page for the current changelog.
.connect() IP/DNS override option (Kornel).trustLocalhost() option for allowing broken HTTPS on localhost.abort() used with promises rejects the promise..end(…) returns undefined instead of the request. If you need the request object after calling .end() (and you probably don't), save it in a variable and call request.end(…). Consider not using .end() at all, and migrating to promises by calling .then() instead..buffer(false) to requests or set superagent.buffer[yourMimeType] = false..pipe() throw.req.abort().end() is called.end() promise on all error events (Kornel Lesiński)https.servername from the Host header (Kornel Lesiński)response.buffered is more accurate.Buffer via send method (Sergey Akhalkov)+json MIME types.superagent.agent(). It now remembers default settings for all its requests..retry() (Alexander Murphy).ok() callback (Jeremy Ruppel)text/ (Damien Clark)withCredentials(false) (Andy Woods)formData.on instead of .once (Kornel Lesiński)attach("file",null) (Kornel Lesiński)retry() and retry(0) (Alexander Pope).retry(n) method and err.retries (Alexander Pope).ok(callback) that allows customizing which responses are errors (Kornel Lesiński).responseType() to Node version (Kornel Lesiński).parse() to browser version (jakepearson)responseType('blob') (Kornel Lesiński).timeout({response:ms}), which allows limiting maximum response time independently from total download time (Kornel Lesiński).end() is called more than once (Kornel Lesiński)response.links to browser version (Lukas Eipert)btoa is no longer required in IE9 (Kornel Lesiński).sortQuery() on URLs without query strings (Kornel Lesiński)ResponseBase (Lukas Eipert).sortQuery() (vicanso).field() (Kornel Lesiński)superagent.Request subclassable without need to patch all static methods (Kornel Lesiński).part()/superagent.Part APIs..body property on internal response object used by unbuffered parsers.
Note: the normal response.body is unaffected..send() calls mixing Buffer/Blob and JSON data are not possible and will now throw instead of messing up the data..send() data object type check (Fernando Mendes)http+unix: schema to support Unix sockets (Yuki KAN)attach options parameter in the Node version (Lapo Luchini)pfx TLS option with new pfx() method. (Reid Burke).on to .once to prevent possible memory leaks (Matt Blair).field() to handle objects (Affan Shahid).catch() for more Promise-like interface (Maxim Samoilov, Kornel Lesiński)event.direction in uploads (Kornel Lesiński)on() method (Juan Dopazo)timedout property to node Request instance (Alexander Pope)null querystring values in node and browser environments. (George Chung)end callback waits for async parsers to finish (Kornel Lesiński).end() callback don't cause the callback to be called twice (Kornel Lesiński)headers to toJSON() (Tao)Breaking changes are in rarely used functionality, so we hope upgrade will be smooth for most users.
.parse() method has been renamed to .serialize() for consistency with NodeJS version.'undefined', now their value is '' (empty string) (shura, Kornel Lesiński).redirect event is called after new query string and headers have been set and is allowed to override the request URL (Kornel Lesiński).then() returns a real Promise. Note that use of superagent with promises now requires a global Promise object.
If you target Internet Explorer or Node 0.10, you'll need require('es6-promise').polyfill() or similar.@api private to have _prefixed names (Kornel Lesiński)FormData error events (scriptype)request.head() supports .redirects(5) call (Kornel Lesiński)response event is also emitted when using .pipe()vnd+json MIME types (Kornel Lesiński).parse() as .serialize() for forward compatibility{type:'auto'} to auth method, which enables browser-native auth types (Jungle, Askar Yusupov)responseType() to set XHR responseType (chris)FormData (Peter Lyons)statusCode to error response when JSON response is malformed (mattdell)a4ddd6a. (Edward J. Jinotti)File object (JD Isaacks)direction property to progress events (Joseph Dykstra)stream.pipe(request) (Keith Grennan)this.request() until call this.end() (vicanso)withCredentials to Node API (markdalgleish)delete breaking on ie8 (kenjiokabe)+json as JSON (Eiryyy)key=1&key=2&key=3 etc... (aalpern, Davis Kim)del() method as delete() (Aaron Krause)then functionres object. See #283..end() callbacks (defunctzombie)field() and attach() functions for HTML5 FormData. (TooTallNate)part(). (TooTallNate)unset() method for removing headers. (bevacqua)Response#toError() have a more meaningful messageRequest#callback().buffer() res.text when no parser matchesthis when window is undefinedBuffer responses [TooTallNate]res.type when a "type" param is present [TooTallNate].send() == .query() special-case (API change !!!).aborted prop.abort(). Closes #115.forbidden response property.timeout(ms). Closes #17res.buffered flag.buffer(false) cancellationquery() to be called after the internal req has been created [tootallnate]res.send('foo=bar') default of "application/x-www-form-urlencoded".end() arity check to node callbacksres.links.head() method [browser]. Closes #78make test-cov support.query(obj). Closes #59res.type (browser). Closes #54res.body and res.files to {}res.type (Content-Type void of params)res.statusCode to mirror noderes.headers to mirror node.auth(username, password)make test-docsRequest#data() for SS, renamed to send()Request#data() from client, renamed to send()EventEmitter#emit()request(url[, fn]) support to the clientqs dependency to package.jsonRequest#pipe()request(url, callback)request(url) as shortcut for request.get(url)Request#pipe(stream)StreamsetEncoding() to utf8 [reported by stagas]res.redirect flag (node)Request#redirects(n) (node).set(object) header field supportContent-Length support.data().get(uri, obj).data() querystring support