//Import the `assert` module to validate results. var assert = require('assert'); var options = { url: "https://some_url.com", "headers": { "oauth_clientid": 123, }, //"timeout": 15000 }; $http.get(options, function(error, response, body) { console.log(response.statusCode + " status code") assert.ok(response.statusCode == 401, 'Expected 401 OK response'); });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter