注册
注册抓包
程序日志参考
--第一次注册请求--<{"RegisterObject":{"DeviceID":"51018220225037172003"}},[Content-Type:"application/json", User-Identify:"51018220225037172003", Connection:"Keep-Alive", Content-Length:"54"]>
--第一次注册返回--<401,[WWW-Authenticate:"Digest realm="viid",qop="auth",nonce="d6c127eab3c64123bf79f2abd4c95096",opaque="426e13372e224b78912afe147f1345ad"", Set-Cookie:"VIIDSPM_JSESSIONID=NjY0NTcxN2ItZTE0Zi00ZTdkLWJmNGMtMDU2MWE2NzRiN2Jj; Path=/; HttpOnly; SameSite=Lax", Content-Length:"0", traceId:"0af3252b9223ea9e", Date:"Mon, 06 Nov 2023 07:53:05 GMT"]>
--第二次注册请求--<{"RegisterObject":{"DeviceID":"51018220225037172003"}},[Content-Type:"application/json", User-Identify:"51018220225037172003", Connection:"Keep-Alive", Content-Length:"54", Authorization:"Digest username="hik", realm="viid", nonce="d6c127eab3c64123bf79f2abd4c95096", uri="/VIID/System/Register", qop=auth, nc=00000001, cnonce="pwz08088", algorithm=MD5, opaque="426e13372e224b78912afe147f1345ad", response="ab47b96080378e817233fad448de7f31""]>
---第二次注册返回--<200,{"ResponseStatusObject":{"Id":"51018220225037172003","StatusString":"注册成功","StatusCode":0,"RequestURL":"/VIID/System/Register","LocalTime":"20231106155305"}},[transfer-encoding:"chunked", Content-Type:"text/plain", traceId:"48ed270cf25e6ad8", Date:"Mon, 06 Nov 2023 07:53:05 GMT"]>
心跳保活
注册成功后,会有一定的有效期(一般为5分钟),在有效期内,如果没有接收到新的请求,注册信息将会失效,下次访问将需要重新注册;当然任何形式的成功请求,都能触发保活机制,重置有效期。
心跳抓包
程序日志参考
--保活请求--<{"KeepaliveObject":{"DeviceID":"51018220225037172003"}},[Content-Type:"application/json;charset=UTF-8", User-Identify:"51018220225037172003", Connection:"keepalive"]>
---保活请求返回结果--<200,{"ResponseStatusObject":{"Id":"51018220225037172003","StatusString":"保活成功","StatusCode":0,"RequestURL":"/VIID/System/Keepalive","LocalTime":"20231106155306"}},[transfer-encoding:"chunked", Content-Type:"text/plain", traceId:"1d47d4c111032561", Date:"Mon, 06 Nov 2023 07:53:06 GMT"]>