Closed maghis closed 8 years ago
Current "master" fails if encoding: null compiling with TS2.0 with --strictNullChecks (? optional allows only undefined, not null).
encoding: null
?
undefined
null
When encoding is null, request returns a binary response (content is a Buffer): marking the field only as optional with ? allows undefined - which means utf8 - but not for null (explained in https://github.com/request/request/blob/master/README.md#requestoptions-callback look for encoding).
encoding
Buffer
utf8
Current "master" fails if
encoding: null
compiling with TS2.0 with --strictNullChecks (?
optional allows onlyundefined
, notnull
).When
encoding
isnull
, request returns a binary response (content is aBuffer
): marking the field only as optional with?
allowsundefined
- which meansutf8
- but not fornull
(explained in https://github.com/request/request/blob/master/README.md#requestoptions-callback look forencoding
).