We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
example code:
const url = 'http://m.qpic.cn/psb?/V12z2enq1EDXnj/mhPPlRUa73TiD7MyHUNr3RAp17dG*cKq91Q*cvA4lrQ!/b/dFIBAAAAAAAA&bo=fgKCAwAAAAADB98!&rf=viewer_4'; function useNodeHttp() { const http = require('http'); http.get(url, res => { if (res.statusCode !== 200) { console.error(`Status Code: ${res.statusCode}`); } let rawData = ''; res.on('data', chunk => { rawData += chunk; }); res.on('end', () => { console.log(`node.http got data: ${rawData.length}`); }); }); } async function useBHttp() { const bhttp = require("bhttp"); const response = await bhttp.get(url); if (response.body.length === 0) { console.log(`bhttp got data: ${response.body.length}`); } } (async function() { useNodeHttp(); useBHttp(); })();
output:
bhttp got data: 0 node.http got data: 1001303
The text was updated successfully, but these errors were encountered:
No branches or pull requests
example code:
output:
The text was updated successfully, but these errors were encountered: