GAT1399协议分析(10)--单图像删除

发布于:2024-06-08 ⋅ 阅读:(114) ⋅ 点赞:(0)

一、官方接口

由于批量删除的接口,图像只能单独删除。

二、wireshark实例

这个接口比较简单,调用request delete即可

文本化:

DELETE /VIID/Images/34078100001190001002012024060513561300065 HTTP/1.1
Host: 10.0.201.56:31400
User-Agent: python-requests/2.32.3
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
content-type: application/VIID+JSON; charset=UTF-8
User-Identify: 34078100005030001003
Content-Length: 0

应答:

文本化:

HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: http://10.0.201.56:31400
Content-Type: application/json; charset=utf-8
Vary: Origin
Date: Thu, 06 Jun 2024 09:26:28 GMT
Content-Length: 219

{
    "RequestURL": "/VIID/Images/34078100001190001002012024060513561300065",
    "StatusCode": 0,
    "StatusString": "æ£å¸¸",
    "Id": "34078100001190001002012024060513561300065",
    "LocalTime": "20240606092628"
}

三、python代码

def DelViidImage(config, imageid):
    url = "http://{ip}:{port}/VIID/Images/{id}".format(ip=config.GAT_1400_IP, port=config.GAT_1400_PORT, id=imageid)

    headers = {
        'content-type': "application/VIID+JSON; charset=UTF-8",
        'User-Identify': config.GAT_DEVICE_ID
    }

    http_response = requests.delete(url=url, headers=headers)

    print(http_response.json())
    return http_response.json()


网站公告

今日签到

点亮在社区的每一天
去签到