当前位置: 首页 > 工具软件 > Requests(PHP) > 使用案例 >

requests.post

袁翰池
2023-12-01

 

import json

import requests


params={"stcd":"0"}
files={"requests":[{"interfaceName":"publicApi.getStationNT","params":{"stcd":"0"},"os":3,"version_code":60,"token":""}]}

url="http://xxxx:8088/swjapp/call.nut"
response=requests.post(url,data=json.dumps(files))
if response.status_code==200:
    print(response.content)
 files={"interfaceName":"publicApi.getStationInfo","params":{"stcd":"xxxx"},"os":3,"version_code":60,"token":""}

    url="http://xxxxx:8088/swjapp/call.nut"
    # response=requests.post(url,data=json.dumps(files),params=json.dumps(params),headers=headers)
    response=requests.post(url,data=json.dumps(files),headers={'Content-Type':'application/x-www-form-urlencoded'})

    if response.status_code==200:
        print(response.content)
        print(response.raw)

 

 类似资料:

相关阅读

相关文章

相关问答