Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added urlencoded example

  • Loading branch information...
commit ef23a543e1daabcae0372ec4981c979be314892a 1 parent 7108751
@tj tj authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 test/multipart.test.js
View
12 test/multipart.test.js
@@ -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"}' });
};
Please sign in to comment.
Something went wrong with that request. Please try again.