Commit dba25762 authored by Kamron Aroonrua's avatar Kamron Aroonrua 💬

do-http

parent 3f9a6f8b
...@@ -51,10 +51,10 @@ function send_request(prm,cb) ...@@ -51,10 +51,10 @@ function send_request(prm,cb)
{ {
options.method = prm.method.toUpperCase(); options.method = prm.method.toUpperCase();
if(body_type=='json' && typeof prm.body == 'object'){ if(prm.body_type=='json' && typeof prm.body == 'object'){
options.headers['content-type'] = 'application/json'; options.headers['content-type'] = 'application/json';
options.json = prm.body; options.json = prm.body;
}else if(body_type=='text' || typeof prm.body == 'string'){ }else if(prm.body_type=='text' || typeof prm.body == 'string'){
options.headers['content-type'] = 'text/plain'; options.headers['content-type'] = 'text/plain';
options.body = prm.body; options.body = prm.body;
}else{ }else{
......
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