source: trip-planner-front/node_modules/needle/examples/digest-auth.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 325 bytes
Line 
1var needle = require('./..');
2
3var opts = {
4 username: 'user3',
5 password: 'user3',
6 auth: 'digest'
7}
8
9needle.get('http://test.webdav.org/auth-digest/', opts, function(err, resp, body) {
10 console.log(resp.headers);
11
12 if (resp.statusCode == 401)
13 console.log('\nIt failed.')
14 else
15 console.log('\nIt worked!')
16});
Note: See TracBrowser for help on using the repository browser.