python request 使用接口传参返回数据

def request_WIP():

    url_http="http://"
    time=datetime.now().strftime("%Y%m%d")
    print(time)
    payload = json.dumps({
        "wipSource": "",
        "wipDate": "",
        "userName": "w",
        "password": ""
    })
    header={
        "Content-Type":"application/json",
        "charset":"UTF-8"
}
    r=requests.request("POST",url=url_http,data=payload,headers=header).content.decode()
    response = json.loads(r)

你可能感兴趣的:(服务器)