Skip to content

Commit

Permalink
Added urlencoded example
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jun 29, 2010
1 parent 7108751 commit ef23a54
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/multipart.test.js
Expand Up @@ -112,4 +112,16 @@ exports['test multipart files'] = function(assert){
assert.ok(res.body.indexOf('{"name":"foo"}') >= 0, 'Test field');
assert.ok(res.body.indexOf('{"path":"/tmp') >= 0, 'Test file path');
});
};

exports['test urlencoded'] = function(assert){
var headers = {
'Content-Type': 'application/x-www-form-urlencoded'
};

var body = 'thanks=felix&for=the&cool=lib';

assert.response(server,
{ url: '/', data: body, headers: headers },
{ body: '{"thanks":"felix","for":"the","cool":"lib"}' });
};

0 comments on commit ef23a54

Please sign in to comment.