Closed neigence closed 4 years ago
Your issue seems related to the web server, we need more information and some code to reproduce the issue (your code depends on a local webserver).
This example works fine
const got = require('got');
(async () => {
const body = await got
.post('http://postman-echo.com/post', {
json: {
hello: 'world',
},
})
.json();
console.log(body);
})();
I think I'm getting the same problem?
Windows 10 v1909 node 14.1.0 got 11.6.0
Open REPL w/ node --experimental-repl-await
> { default: got } = await import('got')
> await got('https://ifconfig.co/', { resolveBodyOnly: true })
''
> await got('http://example.org', { resolveBodyOnly: true })
''
It just returns an empty string for the body every time. No idea what to make of it. Can anyone replicate?
Upgrade your Node.js
Describe the bug
Actual behavior
...
Expected behavior
...
Code to reproduce
Checklist
I am a beginner of this package, after I install got@11.6.0 and run an example, it output nothing.
After I downgrade to got@11.3.0, everything goes fine
const got = require('got');
(async () => { const body = await got.post('http://localhost:8888/test/test', { json: { hello: 'world' } }).json();
})();