github sindresorhus/got v3.0.0
3.0.0

latest releases: v14.2.1, v14.2.0, v14.1.0...
8 years ago

Changes

52490b2 New redirect event

This event fired before any redirect with response and nextOptions objects. You can access cookies and store them to be passed with next request in nextOptions.

got('cookie.com')
    .on('redirect', function (res, nextOptions) {
        nextOptions.headers.cookie = cookie(res);
    });

Breaking changes

2302a1e Redirects enabled only for GET and HEAD methods

As rfc2616 HTTP 1.1 says:

If the 302 status code is received in response to a request other
than GET or HEAD, the user agent MUST NOT automatically redirect the
request unless it can be confirmed by the user, since this might
change the conditions under which the request was issued.

Now got will not auto-redirect you with unsafe methods (like POST or DELETE), which can cause lots of troubles.

v2.9.0...v3.0.0

Don't miss a new got release

NewReleases is sending notifications on new releases.