commit
This commit is contained in:
parent
70e2f7a8aa
commit
008d2f30d7
675 changed files with 189892 additions and 0 deletions
26
node_modules/requests/test/index.html
generated
vendored
Normal file
26
node_modules/requests/test/index.html
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
<div id="output">
|
||||
<h2>Progress log</h2>
|
||||
</div>
|
||||
|
||||
<script src="/dist/requests.js"></script>
|
||||
<script>
|
||||
/**
|
||||
* Poor mans cross browser logger.
|
||||
*
|
||||
* @param {String} line The message that needs to be logged
|
||||
* @api private
|
||||
*/
|
||||
function log(line) {
|
||||
document.getElementById('output').innerHTML += line +'<br />';
|
||||
}
|
||||
|
||||
var r = new Requests('/stream', { streaming: true });
|
||||
|
||||
r.on('data', function (data) {
|
||||
log('<strong>received chunk:</strong> <code>'+ data +'</code>');
|
||||
});
|
||||
|
||||
r.on('end', function () {
|
||||
log('<strong>request has ended</strong>');
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue