Advertisement
luminousjj

python_multiple_demo

Jul 18th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import requests
  2. import json
  3.  
  4. #示例代码以多头借贷为例,其中的url和对应的提交参数需要按照文档中的提示自行更改
  5.  
  6. #创建任务
  7. def create_tasks():
  8.     url = "https://zx-api.juhe.cn/multiple/v1/tasks"
  9.     header={
  10.         'Authorization':'Bearer **********', # 将*号部分换成用户自己的token
  11.         'Content-Type':'application/json'
  12.     }
  13.     # 提交参数必须为 json 格式
  14.     payload = {
  15.          "mobile":"18312345612",
  16.          "user_id":"user_id"
  17.     }
  18.     response=requests.post(url=url,data=json.dumps(body), headers=header)
  19.     print(response.json())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement