We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcd861c commit 61c2674Copy full SHA for 61c2674
test/request.js
@@ -176,6 +176,20 @@ describe('request', function () {
176
});
177
178
it('agent can be used to set default headers', function (done){
179
+ var agent = request.agent('https://httpbin.org');
180
+ agent.set("Header-Name", "header_value");
181
+
182
+ agent
183
+ .get('/headers')
184
+ .then(function (res){
185
+ res.should.have.status(200);
186
+ res.body.headers.should.have.property('Header-Name').that.equals("header_value");
187
+ agent.close();
188
+ })
189
+ .then(done, done);
190
+ });
191
192
+ it('agent can be used to set default basic authentication', function (done){
193
var agent = request.agent('https://httpbin.org');
194
agent.auth("user", "passwd");
195
0 commit comments