source: Dev/trunk/src/node_modules/request/tests/test-emptyBody.js @ 484

Last change on this file since 484 was 484, checked in by hendrikvanantwerpen, 11 years ago

Commit node_modules, to make checkouts and builds more deterministic.

File size: 549 bytes
Line 
1var request = require('../index')
2  , http = require('http')
3  , assert = require('assert')
4  ;
5
6var s = http.createServer(function (req, resp) {
7  resp.statusCode = 200
8  resp.end('')
9}).listen(8080, function () {
10  var r = request('http://localhost:8080', function (e, resp, body) {
11    assert.equal(resp.statusCode, 200)
12    assert.equal(body, "")
13
14    var r2 = request({ url: 'http://localhost:8080', json: {} }, function (e, resp, body) {
15            assert.equal(resp.statusCode, 200)
16            assert.equal(body, undefined)
17            s.close()
18         });
19  })
20})
Note: See TracBrowser for help on using the repository browser.