sindresorhus / got

🌐 Human-friendly and powerful HTTP request library for Node.js
MIT License
14.27k stars 935 forks source link

Incorrect Type on response body when got.extend is used with responseType #1436

Closed nediamond closed 4 years ago

nediamond commented 4 years ago

Describe the bug

Actual behavior

const api = got.extend({responseType: 'json'});
const res = await api.get('https://myapi.com');
res.body # has type string

Expected behavior

const api = got.extend({responseType: 'json'});
const res = await api.get('https://myapi.com');
res.body # has type unknown

Checklist

szmarczak commented 4 years ago

Duplicate of #1117