Skip to content

Commit d453028

Browse files
committed
POST now posts stringify json.
1 parent 447ae0e commit d453028

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

server.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ app.all('/', (req,res) => {
7171
var params = query.params;
7272
var userHeaders = query.proxyHeaders;
7373
}
74-
7574
var data = queryString.stringify(params);
7675
var headers = Object.assign({},userHeaders,{
7776
'User-Agent': 'Proxy.hackeryou.com',
@@ -121,9 +120,8 @@ app.all('/', (req,res) => {
121120
'Content-Type': 'application/x-www-form-urlencoded',
122121
'Accept':'application/json'
123122
}),
124-
body: data
123+
body: JSON.stringify(params)
125124
},(err,response,body) => {
126-
// console.log(response)
127125
if(query.xmlToJSON === 'true') {
128126
body = xml2json.toJson(body);
129127
}
@@ -138,6 +136,7 @@ app.all('/', (req,res) => {
138136
});
139137
}
140138
else {
139+
console.log(data);
141140
request.get({
142141
url: url + '?' + data,
143142
headers: headers

test.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"key" :"217d6bd3a9e78edebe4af03ca28fa01b",
1919
"styleId" :1
2020
},
21-
useCache: true,
21+
useCache: false,
2222
proxyHeaders: {
2323
'X-Something-Cool':'whoooooa'
2424
}

0 commit comments

Comments
 (0)