Commit 3ab04de8 authored by Krit Punpreuk's avatar Krit Punpreuk

Update perform.js

parent 43820025
......@@ -56,7 +56,8 @@ function perform_function(context,request,response){
// Setup Body if POST or PUT
if(method == 'POST' || method == 'PUT') {
if(option.headers['content-type'] && option.headers['content-type'] == 'application/json') {
option.body = JSON.parse(body.replace(/\n/g, "\\\\n"))
option.body = JSON.parse(body.replace(/\n/g, "\\n"))
option.json = true
} else {
option.body = body
}
......@@ -80,7 +81,7 @@ function send_request(option,cb){
cb(new Error("send error"));
}
}else{
cb(error)
cb(new Error("error"))
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment