Skip to content

Commit 1919a11

Browse files
committed
Fixed stupid typo
1 parent f6a2f8d commit 1919a11

File tree

10 files changed

+22
-48
lines changed

10 files changed

+22
-48
lines changed

src/targets/node/unirest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports = function (options) {
5151
code.push(opts.indent + '.end(function(response){')
5252
code.push(opts.indent + opts.indent + 'if (response.error) throw new Error(response.error);');
5353
code.push(null);
54-
code.push(opts.indent+opts.indent+ 'console.log(reponse.body);');
54+
code.push(opts.indent+opts.indent+ 'console.log(response.body);');
5555
code.push(opts.indent+'});');
5656
code.push(null);
5757

test/fixtures/output/node/unirest/application-form-encoded.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ unirest.post("http://mockbin.com/har")
55
.end(function(response){
66
if (response.error) throw new Error(response.error);
77

8-
console.log(reponse.body);
8+
console.log(response.body);
99
});
1010

test/fixtures/output/node/unirest/application-json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ unirest.post("http://mockbin.com/har")
55
.end(function(response){
66
if (response.error) throw new Error(response.error);
77

8-
console.log(reponse.body);
8+
console.log(response.body);
99
});
1010

test/fixtures/output/node/unirest/cookies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ unirest.post("http://mockbin.com/har")
99
.end(function(response){
1010
if (response.error) throw new Error(response.error);
1111

12-
console.log(reponse.body);
12+
console.log(response.body);
1313
});
1414

test/fixtures/output/node/unirest/full.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ unirest.post("http://mockbin.com/har")
1212
.end(function(response){
1313
if (response.error) throw new Error(response.error);
1414

15-
console.log(reponse.body);
15+
console.log(response.body);
1616
});
1717

test/fixtures/output/node/unirest/headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ unirest.get("http://mockbin.com/har")
55
.end(function(response){
66
if (response.error) throw new Error(response.error);
77

8-
console.log(reponse.body);
8+
console.log(response.body);
99
});
1010

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
1-
var request = require("request");
1+
var unirest = require("unirest");
22

3-
request({
4-
"method": "POST",
5-
"url": "http://mockbin.com/har",
6-
"headers": {
7-
"Content-Type": "multipart/form-data"
8-
},
9-
"formData": {
10-
"foo": {
11-
"value": "Hello World",
12-
"options": {
13-
"filename": "hello.txt",
14-
"contentType": "text/plain"
15-
}
16-
}
17-
}
18-
}, function (error, response, body) {
19-
if (error) throw new Error(error);
3+
unirest.post("http://mockbin.com/har")
4+
.type("multipart/form-data")
5+
.end(function(response){
6+
if (response.error) throw new Error(response.error);
207

21-
console.log(body);
22-
});
8+
console.log(response.body);
9+
});
2310

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
1-
var request = require("request");
1+
var unirest = require("unirest");
22

3-
request({
4-
"method": "POST",
5-
"url": "http://mockbin.com/har",
6-
"headers": {
7-
"Content-Type": "multipart/form-data"
8-
},
9-
"formData": {
10-
"foo": {
11-
"value": "Hello World",
12-
"options": {
13-
"filename": "hello.txt",
14-
"contentType": "text/plain"
15-
}
16-
}
17-
}
18-
}, function (error, response, body) {
19-
if (error) throw new Error(error);
3+
unirest.post("http://mockbin.com/har")
4+
.type("multipart/form-data")
5+
.end(function(response){
6+
if (response.error) throw new Error(response.error);
207

21-
console.log(body);
22-
});
8+
console.log(response.body);
9+
});
2310

test/fixtures/output/node/unirest/query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ unirest.get("http://mockbin.com/har")
55
.end(function(response){
66
if (response.error) throw new Error(response.error);
77

8-
console.log(reponse.body);
8+
console.log(response.body);
99
});
1010

test/fixtures/output/node/unirest/short.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ unirest.get("http://mockbin.com/har")
44
.end(function(response){
55
if (response.error) throw new Error(response.error);
66

7-
console.log(reponse.body);
7+
console.log(response.body);
88
});
99

0 commit comments

Comments
 (0)