GKLBB

当你经历了暴风雨,你也就成为了暴风雨

导航

统计

软件编程 --- 发http包

 

复制代码
# 时间 12:08
# "expires_in": 171205,

import requests
import json
from datetime import datetime
import time

url = "https://jywgappthw.chinatowercom.cn:9000/workorder/bill/getBillList/"
headers = {
    "Authorization": "Bearer 8758805f-cf24-4e43-ad8c-a661e76c206f",
    "User-Agent": "Mozilla/5.0 (Linux; Android 11; 2112123AC Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.131 Mobile Safari/537.36 uni-app Html5Plus/1.0 (Immersed/24.0)",
    "Content-Type": "application/json",
}

payload = {
    "userId": "91c7750eadc144948ba558fc367c9c8d",
    "roleId": "0100070",
    "billType": "ACCEPT",
    "pageNumber": 1,
    "pageSize": 10,
    "billStatus": "",
    "areaId": "",
    "businessType": "",
    "beginTimeType": "",
    "cityId": "",
    "provId": "",
    "stationCode": "",
    "stationName": "",
    "deviceName": "",
    "deviceCode": "",
    "billSn": ""
}

while True:
    # Making the POST request
    response = requests.post(url, headers=headers, json=payload)

    # Writing response to a file
    timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    with open("C://1.txt", "w") as file:
        file.write(f"Response Time: {timestamp}\n\n")
        file.write(f"Response Headers:\n{json.dumps(dict(response.headers), indent=2)}\n\n")
        file.write(f"Response Body:\n{json.dumps(response.json(), indent=2)}")

    # Introduce a delay (1 minute in this example)
    time.sleep(60)
复制代码

 

posted on   GKLBB  阅读(6)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现
历史上的今天:
2021-11-24 rog游戏手机2 解bl锁 刷机
点击右上角即可分享
微信分享提示