Advertisement
luminousjj

nodejs_multiple_demo

Jul 18th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //示例代码以多头借贷为例,其中的url和对应的提交参数需要按照文档中的提示自行更改
  2.  
  3. var request = require("request");
  4.  
  5. //创建任务
  6. var options = { method: 'POST',
  7.   url: 'https://zx-api.juhe.cn/multiple/v1/tasks',
  8.   headers:
  9.    {
  10.      'Content-Type': 'application/json',
  11.      'Authorization': 'Bearer ***********' },  //将*号部分换成用户自己的token
  12.   body:
  13.    { mobile: '1831*****',
  14.      user_id: 'user_id' },
  15.   json: true };
  16.  
  17. request(options, function (error, response, body) {
  18.   if (error) throw new Error(error);
  19.  
  20.   console.log(body);
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement