Also, we could possibly add these hooks:
beforeRedirectbeforeRetrybeforeErrorAlso see https://github.com/sindresorhus/ky/pull/128#issuecomment-485771938 (mutableDefaults)
Ky has a json option, whereas Got automatically detects objects in the body option and acts accordingly. Would be nice to make a decision on which one is better and have the same API. I think I lean towards the latter. I guess the idea with the json option was to simplify the implementation, but here we have to check for the case where both body and json were used and if so, throw an error. So maybe it's a wash?
Ky has a json option, whereas Got automatically detects objects in the body option an acts accordingly.
Got has a json option too. body is meant for strings, buffers, streams and form-data instances only. This is beacuse we don't know if we should call .toString() or JSON.stringify(...).
This example may be out of date, then?
Indeed. I think @sindresorhus has told me about it some time ago and I forgot to change that :P
A before error hook would be a nice addition to handle timeouts or specific errors that can be handled in the same way to prevent unnecessary duplication of error handling code.